有没有W3C兼容的黑客IE6和7? [英] Are there W3C-compatible hacks for IE6 and 7?

查看:91
本文介绍了有没有W3C兼容的黑客IE6和7?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在IE6和7中是否存在适用于W3C兼容性的有效黑客?

Are there valid hacks in IE6 and 7 for W3C compatibility?

我相信在使用黑客时有W3C不兼容。例如,使用以下CSS代码(如本文选项2所示: http://webdesignerwall.com/tutorials/css-specific-for-internet-explorer?cp=1 ):

I believe there are W3C incompatibilities when using hacks. For example, using the following CSS code (as suggested under option 2 in this article: http://webdesignerwall.com/tutorials/css-specific-for-internet-explorer?cp=1):

.box {
    height:200px;
    _height:200px;
}

在W3C CSS验证器中给我以下错误:

gave me the following error in the W3C CSS validator:

Property _height doesn't exist : 200px 200px

如果我错了请指教。

谢谢。

推荐答案

这个替代的hack应该这样做:

This alternative hack should do it:

/* Both of the following will be used by IE only. */
* html .box{height:200px;} /* IE6 only */
*+html .box{height:200px;} /* IE7 only */

这篇关于有没有W3C兼容的黑客IE6和7?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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