Home  >  Article  >  Web Front-end  >  Control the vertical centering of text in HTML text boxes through css_HTML/Xhtml_Web page production

Control the vertical centering of text in HTML text boxes through css_HTML/Xhtml_Web page production

WBOY
WBOYOriginal
2016-05-16 16:38:381747browse

When the height attribute of Text is defined, the text entered in Text is not vertically centered. However, you can add CSS to control it so that the entered text is vertically centered to make the web page more perfect.

Copy code
The code is as follows:


< head>









Join verticla-align, After setting the two properties of line-height, the text in the text box will be vertically centered in the text box. It should be noted that line-height must be equal to height.
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