html – Internet Explorer中文本输入中的垂直中心文本

前端之家收集整理的这篇文章主要介绍了html – Internet Explorer中文本输入中的垂直中心文本前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我无法在Internet Explorer的输入字段中垂直对齐文本.

我有:

  1. input#search {
  2. float:left;
  3. font-size:11px;
  4. height:20px;
  5. margin:0;
  6. padding-left:4px;
  7. width:100px;
  8. }

在Firefox和Chrome中,它似乎是自动垂直对齐的,但是在Internet Explorer中却不是.

解决方法

只需设置输入对象的高度和行高,即可正常工作(即7).
  1. input { border: 0; font-size: 0.8em; height: 32px; line-height: 32px;}

GL保罗布埃诺

猜你在找的HTML相关文章