【问题标题】:Is there a way to condition a CSS styling to execute only on IE quirks mode?有没有办法将 CSS 样式设置为仅在 IE 怪癖模式下执行?
【发布时间】:2010-12-11 07:33:47
【问题描述】:

我想编写一个跨浏览器小部件,以集成到 IE 标准和 quirks 模式页面(当然,FF 很容易)。

由于我只想编写一次样式,因此我想将一些样式语句设置为仅在怪癖/标准模式下执行。

有办法吗?

据我了解,_hack 和 IE 条件 cmets 都只允许我区分不同的浏览器,而不是不同的浏览器模式。

【问题讨论】:

    标签: css internet-explorer cross-browser conditional-statements quirks-mode


    【解决方案1】:
    var isIeQuirksMode = (document.all && document.compatMode !== 'CSS1Compat');
    alert('In quirks mode: ' + isIeQuirksMode);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-09
      • 2014-05-08
      • 2011-04-15
      • 1970-01-01
      • 2016-02-12
      • 2011-07-01
      相关资源
      最近更新 更多