HTML textarea text field

 TextArea HTML tags are used to establish more than one text input field lines, as compared to a single line input field <input type = "text">, and may allow users to enter text TextArea plurality of lines, and has a function scrollbar, the HTML , You can specify the height and width of the textarea field through rows and cols. The standard HTML textarea text input field is from the beginning of <textarea> to the end of </textarea>. To have an interactive effect, it must be combined with the HTML Form function.


HTML textarea text input field example
<textarea cols="50" rows="5">
 Enter what you want to write...
</textarea>
Example presentation results

You can see that in the example, the text you want to write is wrapped with <textarea></textarea>, and the size requirements such as width cols=50 and height rows=5 are added, but this writing method is not very ideal. It is recommended Use CSS width and height to set the width and height. It is more accurate. Please refer to the following example.

CSS control textarea length and width example
<textarea style="width:300px;height:100px;">
 Enter what you want to write...
</textarea>
The output of the above example

In addition to controlling the width and height of the text input field, CSS can also control many other items, such as border thickness, border color, border style, background color, background image, scrollbar display and style... etc. We will Introduce in other pages. Almost all major browsers support HTML <textarea> tags.

Post a Comment

0 Comments