CSS Cascade, Specificity & Inheritance
Read CSS conflicts the way the engine does: specificity by column, why @layer order outranks specificity (and how !important reverses it), unlayered-beats-layered, inherited vs. initial/revert/unset, and :where()'s zero specificity. Answers follow the CSS Cascade and Selectors specifications.
Questions
- Not answered. An
<a>matches both rules below — which color wins? - Not answered. What is the specificity of
#sidebar ul li a.active? - Not answered. In the specificity of
nav.primary > ul li.active a:hover, what is the B column? - Not answered. Which statements about the specificity of functional pseudo-classes are correct?
- Not answered. What color is the heading, given these cascade layers?
- Not answered. With
!importanton both rules, which layer wins? - Not answered. An unlayered rule and a layered rule conflict — which wins?
- Not answered. Does the stylesheet override this inline style?
- Not answered. Which of these properties inherit by default?
- Not answered. What is the computed
displayof a<div>withdisplay: initial? - Not answered. And with
display: reverton the same<div>? - Not answered. Which CSS-wide keyword acts as
inheritfor inherited properties andinitialotherwise?