Explanation of the problem:
So, if you have a CSS rule that looks something like this:
h1, h1 a:hover {
color: blue;
}
It works great, the example may be the best in terms of usability, but it works. (And this works to demonstrate the problem ...)
But if you add a comma separated ( , ) that the browser does not understand, the hole rule is ignored.
h1, h1 a:hover, h1:focus-within {
color: blue;
}
A browser that does not understand : the alias of the focus-in class ignores the entire rule . This means that even h1 will not receive the specified rule.
Then he wonders why this is so:
Do not misunderstand me. Ignoring things they donโt know is a very powerful feature in CSS!
, , , ?
, , .
, , , , .
, - , , , .
:
, "" :
h1, h1 a:hover {
color: blue;
}
h1:focus-within {
color: blue;
}
. (- "" )
.