【问题标题】::root imported CSS not working in safari and IE 11:root 导入的 CSS 在 Safari 和 IE 11 中不起作用
【发布时间】:2018-02-24 04:41:47
【问题描述】:

:root 选择器在某些浏览器中不起作用。

代码:

:root {
    --blue: #4d6fd3;
    --yellow: #d8c812;
}
h1{
    color: var(--blue);
}
h2{
    color: var(--yellow);
}
<h1>This is a heading with blue color</h1>
<h2>This is a heading with yellow color</h2>

这些导入的 CSS 不适用于 Safari 5.1.7IE11

【问题讨论】:

  • CSS 变量在 IE11 中为 not supported
  • 什么版本的 Safari?如前所述,IE11 根本不支持该功能。
  • Safari 5.1.7
  • 此浏览器已有 5 年历史,从那时起就没有收到任何更新(甚至没有收到任何更新(甚至没有安全更新)...为了您的计算机安全,请立即停止使用它。使用虚拟机直接在osX上测试当前版本(10.1.2)
  • 如果您想知道,它确实适用于最新的 safari。

标签: html css safari internet-explorer-11 css-variables


【解决方案1】:

这个css3选择器在所有边缘浏览器中都能正常工作,所以有一点问题,请看我的图片,希望对你有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-06-07
    • 2016-05-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-04
    相关资源
    最近更新 更多