我的博客上搜索提交按钮上的文本在Firefox 4中位置非常低,但在Chrome 10或IE9中则没有。我已经尝试了几乎所有的方法,除了降低文本字体大小之外,没有任何一种方法可以解决这个问题,但这并不是最佳方案,因为文本会变得太小。
截图
Windows 7上的Firefox 4:
Windows 7上的Google Chrome 10.0.648.204:
相关HTML代码:
<form method="get" class="searchform" action="http://eligrey.com/blog">
<input type="search" placeholder="search" name="s" />
<input type="submit" value="🔍" title="Search" />
</form>
相应的CSS规则(来自http://eligrey.com/blog/wp-content/themes/eligrey.com/style.css):
.searchform input[type="submit"] {
font-family: "rfhb-lpmg";
color: #ccc;
font-size: 3em;
background-color: #959595;
text-align: center;
border: 1px solid #888;
height: 34px;
width: 42px;
line-height: 34px;
-webkit-border-bottom-right-radius: 4px;
-webkit-border-top-right-radius: 4px;
-moz-border-radius-bottomright: 4px;
-moz-border-radius-topright: 4px;
border-bottom-right-radius: 4px;
border-top-right-radius: 4px;
-webkit-background-clip: padding-box;
-moz-background-clip: padding-box;
background-clip: padding-box;
-webkit-transition-property: border, background-color, box-shadow;
-webkit-transition-duration: 0.2s;
-moz-transition-property: border, background-color, box-shadow;
-moz-transition-duration: 0.2s;
}
rfhb-lpmg 是我制作的一种自定义字体,它使用简单的字形实现了旋转的花式心形符号 U+2767 和右指向放大镜符号 U+1F50E。
vertical-align
属性吗? - Karl Andrewvertical-align:middle
,但它没有起作用。 - Eli Grey