v133 · dom
Glossary Document
Technical terms in the article below are dotted-underlined. Hover or focus any term to see its definition as a popover=hint. Opening the definition of one term doesn't close another — hints have their own top-layer stacking lane that doesn't interfere with other popovers.
The CSS Rendering Model
At the heart of every stylesheet is the , the algorithm that resolves which declaration wins when multiple rules compete for the same property. Understanding it removes the guesswork from debugging overrides.
Within the cascade, declarations are ranked first by origin (browser, author, user), then by . Specificity is a three-part tuple — inline styles, IDs, and classes/attributes/pseudo-classes — calculated independently of document order.
Once the winning declaration is chosen it enters the as a style rule. The browser walks the rule tree, evaluates custom properties, and produces for every element.
Inheritance and Custom Properties
Many properties participate in
.
When no value is declared for an element, the browser walks the element's ancestors and uses the
first declared value it finds. This is why setting color on <body>
colours all descendant text.
(CSS variables) inherit by default and can be used to propagate design tokens down the tree without re-declaring them at every level.
Why hints don't close menus
popover=auto, opening one definition would dismiss any open menu — the exact opposite of what a glossary doc needs.<!-- Term in the document -->
<button
popovertarget="hint-cascade"
popovertargetaction="toggle">cascade</button>
<!-- Definition rendered in the top layer -->
<div id="hint-cascade" popover="hint">
<strong>Cascade</strong>
The algorithm that resolves competing CSS declarations…
</div>
/*
No JavaScript needed — popovertarget wires the button to
the popover. popover=hint keeps the definition from
closing any open auto popover (nav menus, dropdowns).
*/