Answers for "how does textarea indicate a space"

CSS
1

how to take in space and enter as it is in a textarea

white-space: pre-wrap;
Posted by: Guest on June-12-2021
0

textarea adds unwanted spaces

<!-- Most likely, this is the problem.
You've probably written something along the lines of: -->

<textarea id="my-textarea" class="textarea-for-page" cols="20" rows="5">
	Your Text Here
</textarea>

<!-- However, textareas behave differently from divs, inputs and other
HTML elements. Code like the one above will add a line break, four
blank spaces, "Your Text Here", and another blank space inside of
your textarea.
To avoid this, simply write everything in one single line, and only add
line breaks or white spaces if you want them to show in your page.
To fix the example, the code should be written like this: -->

<textarea id="my-textarea" class="textarea-for-page" cols="20" rows="5">Your Text Here</textarea>
Posted by: Guest on February-21-2022

Code answers related to "how does textarea indicate a space"

Browse Popular Code Answers by Language