有没有任何IE8只有css hack? [英] is there any IE8 only css hack?

查看:101
本文介绍了有没有任何IE8只有css hack?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于Internet Explorer 8(IE8),我想使用以下CSS:

For Internet Explorer 8 (IE8) I'd like to use the following CSS:

color : green;

我想应用一个只影响IE8的黑客,而不是IE9,IE6和7。 / p>

I would like to apply a hack which only affects IE8, not to IE9, IE6 and 7.

推荐答案

在HTML中使用条件注释,如下所示:

Use conditional comments in HTML, like this:

<!--[if IE 8]>
<style>...</style>
<![endif]-->

请参阅: http://www.quirksmode.org/css/condcom.html

您可以测试IE版本可靠,并确保其他浏览器不会混淆。

You can test for IE versions reliably and also be sure other browsers won't be confused.

这篇关于有没有任何IE8只有css hack?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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