Home > Web Front-end > HTML Tutorial > 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
Release: 2016-05-16 16:38:38
Original
1778 people have browsed it

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.
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template