I have a simple text area in a form like this:
<textarea style="width:350px; height:80px;" cols="42" rows="5" name="sitelink"> <?php if($siteLink_val) echo $siteLink_val; ?> </textarea>
I keep getting extra white space in this textarea. When I tab into it my cursor is like in the middle of the textarea and not in the beginning? What is the explanation?
Just put your php open tag right after the textarea close tag.. Dont use line break.. And close php exactly before (as you have done).. This will erase all the whitespaces..
Alternatively referred to as spacing or whitespace, white space is any section of a document that is unused or space around an object. White spaces help separate paragraphs of text, graphics, and other portions of a document, and helps a document look less crowded.
Description. The HTML <pre> tag defines preformatted text preserving both whitespace and line breaks in the HTML document. This tag is also commonly referred to as the <pre> element.
The <textarea> tag defines a multi-line text input control. The <textarea> element is often used in a form, to collect user inputs like comments or reviews. A text area can hold an unlimited number of characters, and the text renders in a fixed-width font (usually Courier).
Look closely at your code. In it, there are already three line breaks, and a ton of white space before </textarea>
. Remove those first so that there are no line breaks in between the tags any more. It might already do the trick.
Well, everything between <textarea>
and </textarea>
is used as the default value for your textarea box. There is some whitespace in your example there. Try to eliminate all of that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With