Here's the situation - the parent element has the CSS property all: unset
.
I noticed that in Safari (Version 12.1.1 (14607.2.6.1.1)
), all the children of this parent are only affected by the *
selector, ignoring inline styles and even the !important
declaration.
Interestingly, this behavior only applies to the color
property; the background-color
property works as expected.
Everything displays correctly in Chrome, so is this a glitch in Safari or did I make an error somewhere? And how can I resolve this issue in Safari?
* {
color: red; /* Text color uses this value */
background-color: pink;
}
.Parent {
all: unset;
}
.Child {
color: blue;
background-color: yellow; /* Background color uses this value */
}
<div class="Parent">
<div class="Child">Some Text</div>
</div>
Expected output in Chrome: https://i.sstatic.net/uM91Q.png
Unexpected display in Safari
Version 12.1.1 (14607.2.6.1.1)
: https://i.sstatic.net/oTgMF.png