css - 在 IE 中修复 CSS <!--[if lt IE 8]>

标签 css internet-explorer internet-explorer-8

我该如何使用它:

    <!--[if lt IE 8]>
    <style type='text/css'>
  #header ul#h-menu li a{font-weight:normal!important}
    </style>
    <![endif]-->

如果我删除 <!--[if lt IE 8]><![endif]--> ,上面的代码在 IE 8 中运行良好,但如果我不这样做,它就不会运行。 帮助我修复 IE,以便我可以在所有 IE 版本中使用上面的代码。

我要密码 #header ul#h-menu li a{font-weight:normal!important}仅在 IE 中运行。

最佳答案

如果你想让它在 IE 8 及以下版本中工作,请使用

<!--[if lte IE 8]>

lte 意思是“小于或等于”。

有关条件注释的更多信息,请参见例如quirksmode.org page .

关于css - 在 IE 中修复 CSS &lt;!--[if lt IE 8]>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3958913/

相关文章:

IE 和 Chrome 中的 CSSStyleDeclaration 差异

html - 在 Mac 上测试 IE 网页设计的最佳方式?

python - Internet Explorer 8 中提示文件下载时原型(prototype) Ajax.Request 出现问题

html - IE8 重叠 float div 中的内联 block 元素

css - Bootstrap 3 : Navbar and IE8 not respecting respond. js?

css - Wordpress 上的简单自定义 CSS 无法正常工作

html - 如何为可变数量的内联元素设置内边距?

html - 辅助功能:在小型设备上以模态显示内容,在大型设备上显示内联内容

javascript - IE9 中未定义初始传递的 For 循环索引

html - 创建自定义 CSS 以覆盖默认 CSS