让input文本框文本垂直居中代码实例_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:30:32
Original
1728 people have browsed it

让input文本框文本垂直居中代码实例:
很多时候讲究对称美,也有时候讲究不对称的美,当然这个要分具体情况,在文本框中一般对称一些更为美观,下面就通过代码实例介绍如何实现文本框中的文本垂直居中对齐。
代码实例如下:

 

<!DOCTYPE html><html><head><meta charset=" utf-8"><meta name="author" content="http://www.softwhy.com/" /><title>蚂蚁部落</title><style type="text/css"> #text{   height:50px;   line-height:50px;} </style> </head> <body> <input type="text" id="text" value="蚂蚁部落欢迎您"/> </body> </html>
Copy after login

 

以上代码实现了我们的要求,将height属性值和line-height属性值设置为相同即可。

原文地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=12698

更多内容可以参阅:http://www.softwhy.com/divcss/

 

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