css – display:inline-block和text-indent

前端之家收集整理的这篇文章主要介绍了css – display:inline-block和text-indent前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在某些版本的Internet Explorer中遇到以下代码的问题: @H_301_2@#iconautente{ background-image:url('/style/images/spritecommon.png'); /*icona_utente.png*/ background-position:-117px -15px; text-indent:-9000px; width:20px; height:23px; display:inline-block; } <a id="iconautente" href="/admin/index.PHP">admin</a>

在Vista下的Firefox,IE7和IE8中,我看到了背景和没有文字,正如预期的那样.在XP下的IE6和IE8中,整个图像是缩进的,而不是文本,因此不显示图像.

什么应该是正确的行为?有解决方法吗?

解决方法

@H_301_2@* html #iconautente{text-indent:0; line-height:0; font-size:0; overflow:hidden}/*ie6 hack */ *:first-child+html #iconautente{ text-indent:0; line-height:0; font-size:0; overflow:hidden}/*ie7 hack */

猜你在找的CSS相关文章