How to set the size of the text box in css: first create a new html file; then use the input tag to create a text box of type text; finally use the width attribute and height attribute to set the width and height of the input.
The operating environment of this article: Windows7 system, HTML5&&CSS3 version, Dell G3 computer.
Create a new html file, named test.html, to explain how to use CSS to set the size of the text box and the maximum number of input words.
In the test.html file, use the input tag to create a text box of type text, and set its default value to empty.
In the test.html file, use the maxlength attribute to set the input box to a maximum of 10 words.
##In the test.html file, write the tag. The css style of the page will be written in this within the label. In the css tag, set the css style of the input element through its name, use the width attribute to set the width of the input to 300px, and use the height attribute to set the height of the input to 30px. Open the test.html file in the browser to check the effect. For more detailed HTML/CSS knowledge, please visit theCSS Video Tutorial column!
The above is the detailed content of How to set the text box size in css. For more information, please follow other related articles on the PHP Chinese website!