ie7 text-indent input影响

IE6/IE7中text-indent对input背景的影响

text-indent在IE6/IE7中的位置偏移BUG一文中讨论过IE6/IE7中inline-block元素设置text-indent对背景图片的影响,这主要是 display:inline-block在IE6/Ie7和IE8中的区别 导 致的。表单中的提交(type=submit)和重置(type=reset)按钮,有时我们为了美化,而使用背景图片,考虑到SEO因素,按钮的 value值不能为空,但又不能在页面上显示出来。这时就可以用text-over:-200em;overflow:hidden;来隐藏了。这时问题 就出现了,在IE6/IE7中背景图片也和文字一块被隐藏了。

解决办法也是一样的。就是给按钮设置display:block或者设置float:left|right来实现display:block。

<input type="submit" class="submit" value="提交" />
<style type="text/css">
.submit{
display:block;
width:150px;
height:30px;
overflow:hidden;
background:url(submit.gif) no-repeat left top;
text-indent:-100em;
}
</style> 由此推断IE6/IE7中input的实现和inline-block类似null

posted @ 2013-10-21 10:25  淡然_  阅读(335)  评论(0编辑  收藏  举报