Home  >  Article  >  Web Front-end  >  How to set the text field size in html

How to set the text field size in html

coldplay.xixi
coldplay.xixiOriginal
2021-03-10 17:34:217684browse

How to set the size of the text field in html: first create a new html page, add a label tag and an input box; then modify the width by setting the size attribute; and finally preview the effect.

How to set the text field size in html

The operating environment of this tutorial: windows7 system, html5 version, DELL G3 computer.

htmlHow to set the text field size:

1. First, use sublime text2 to create a new html page for testing. I call it test.html

How to set the text field size in html

#2. At this time, add a label tag and an input box to the web page.

How to set the text field size in html

3. Preview the effect. We can know that the default width is 10

How to set the text field size in html

4. Here we set The size attribute changes the width.

How to set the text field size in html

5. Preview the effect again. Has the width been reduced?

How to set the text field size in html

#6. If you simply change the width, this is enough, but if you modify other things. We need to add the style attribute

How to set the text field size in html

#7 to preview the final effect. You can see that the width and height have changed

How to set the text field size in html

Related learning recommendations:html video tutorial

The above is the detailed content of How to set the text field size in html. 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