Home >Web Front-end >Front-end Q&A >How to set the text box size in css

How to set the text box size in css

藏色散人
藏色散人Original
2021-04-29 10:02:399813browse

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.

How to set the text box size in css

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.

How to set the text box size in css

In the test.html file, use the input tag to create a text box of type text, and set its default value to empty.

How to set the text box size in css

In the test.html file, use the maxlength attribute to set the input box to a maximum of 10 words.

How to set the text box size in css

##In the test.html file, write the tag. The css style of the page will be written in this within the label.

How to set the text box size in css

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.

How to set the text box size in css

Open the test.html file in the browser to check the effect.

How to set the text box size in css

For more detailed HTML/CSS knowledge, please visit the

CSS 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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn