IE8中的垂直对齐不正确 [英] Incorrect vertical alignment in IE8

查看:85
本文介绍了IE8中的垂直对齐不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的搜索框中的默认文字在Chrome,FF和Safari(vertical-align:middle)中看起来不错。

The default text in my search box looks fine in Chrome, FF, and Safari (vertical-align: middle).

但是,在IE 8中上升到搜索框的顶部。

However, the default text rises to the top of the search box in IE 8.

有没有IE的解决方法?非常感谢您的帮助。

Is there a workaround for IE? Thanks for your help.

HTML

<input type="text" class="text" value="Search" title="Search" />

CSS:

.text {
    height: 47px;
    font-size: 18px;
    margin: 0; 
    padding: 0 5px 0 45px;
}


推荐答案

高度匹配文本框的高度?文字应自动出现在

Have you tried setting the line height to match the height of the text box? The text should automatically appear in the middle of the line

这篇关于IE8中的垂直对齐不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆