Back to the Catalog
css
frontend

CSS Cascade, Specificity & Inheritance

12 questions

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

  1. Not answered. An <a> matches both rules below — which color wins?
  2. Not answered. What is the specificity of #sidebar ul li a.active?
  3. Not answered. In the specificity of nav.primary > ul li.active a:hover, what is the B column?
  4. Not answered. Which statements about the specificity of functional pseudo-classes are correct?
  5. Not answered. What color is the heading, given these cascade layers?
  6. Not answered. With !important on both rules, which layer wins?
  7. Not answered. An unlayered rule and a layered rule conflict — which wins?
  8. Not answered. Does the stylesheet override this inline style?
  9. Not answered. Which of these properties inherit by default?
  10. Not answered. What is the computed display of a <div> with display: initial?
  11. Not answered. And with display: revert on the same <div>?
  12. Not answered. Which CSS-wide keyword acts as inherit for inherited properties and initial otherwise?