小编Sat*_*tya的帖子

:root导入的CSS无法在safari和IE 11中运行

:root Selector在某些浏览器中不起作用.

码:

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

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

html css safari internet-explorer-11 css-variables

5
推荐指数
1
解决办法
1562
查看次数

标签 统计

css ×1

css-variables ×1

html ×1

internet-explorer-11 ×1

safari ×1