Setting method: 1. Set the cols and rows attributes to textarea, the syntax is ""; 2. Add "width" to exarea :width value;height:height value;" style.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
html textarea set size
The text area can hold an unlimited amount of text, and the default font for the text is a fixed-width font (usually Courier).
<textarea>我是一个文本框。</textarea>
You can specify the size of the textarea through the cols and rows attributes, but a better way is to use the CSS height and width attributes.
1. Use the cols and rows attributes
cols: Specifies the visible width within the text area.
rows: Specifies the number of visible rows in the text area, that is, the height.
<textarea rows="10" cols="30">我是一个文本框。</textarea>
2. Use CSS height and width attributes
<textarea style="max-width:90%">我是一个文本框。</textarea>
Recommended tutorial: "html video tutorial"
The above is the detailed content of How to set the size of html textarea. For more information, please follow other related articles on the PHP Chinese website!