:root imported CSS not working in safari and IE 11

html css safari internet-explorer-11 css-variables

1482 观看

1回复

28 作者的声誉

:root Selector is not working in some of the browsers.

Code:

: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>

These imported CSS are not applied in Safari 5.1.7 and IE11.

作者: Satya 的来源 发布者: 2017 年 9 月 15 日

回应 1


0

489 作者的声誉

决定

This css3 selector works fine in all edge browser, so have a little issues, please see my image, and I hope that help you.

enter image description here

作者: nifoem bar 发布者: 2017 年 9 月 16 日
32x32