如何垂直对齐输入类型中的文本=“text”? [英] How to vertically align text in input type="text"?
本文介绍了如何垂直对齐输入类型中的文本=“text”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有< input type =text/>
我需要设置输入文本的垂直对齐。例如中间或顶部。
http://jsfiddle.net/eSPMr/
There is <input type="text" />
I need to set vertical alignment of the entered text. For example middle or top.
http://jsfiddle.net/eSPMr/
推荐答案
使用填充来伪造,因为vertical-align在文本输入上不起作用。
Use padding to fake it since vertical-align doesn't work on text inputs.
jsFiddle example
CSS
.date-input {
width: 145px;
padding-top: 80px;
}
这篇关于如何垂直对齐输入类型中的文本=“text”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文