Home>Article>Web Front-end> How to set the size of the text field in html
In HTML, you can use the width attribute and height attribute to set the size of the text area. You only need to add the "width: width value; height: height value;" style to the text area label textarea.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
htmlText field
There is also a specially defined text style in HTML, called text city. The difference between it and a text box is that you can add multiple lines of text, so you can enter more text. This type of control is most common on some message boards.
The syntax is as follows:
Text field label attribute | Description |
name | The name of the text field |
rows | The number of rows in the text field |
cols | The number of columns in the text field |
#value | The default value of the text field |
[Recommended tutorial: "html video tutorial"]
htmlHow to set the size of the text field
Rendering :
css width and height attributes
The width attribute sets the width of the element.
The height attribute sets the height of the element.
Value | Description |
---|---|
auto | Default value. The browser can calculate the actual width or height. |
length | Define width or height using units such as px, cm, etc. |
% | # Defines a percentage width or height based on the width of the containing block (parent element). |
For more programming related knowledge, please visit:Programming Video! !
The above is the detailed content of How to set the size of the text field in html. For more information, please follow other related articles on the PHP Chinese website!