When the cascade finds no declaration for a property, defaulting supplies one. Every property's definition table has an "Inherited" line:
- Inherited properties take the parent's computed value. They're mostly about text:
color,font-*,line-height,letter-spacing,text-align,white-space,visibility,cursor,list-style. Custom properties inherit too. - Everything else takes its initial value from the definition table:
margin,padding,border,background,display,width,position,overflow.
The root element has no parent, so it gets initial values. Inheritance follows the flattened tree: a slotted element inherits from its <slot>, not its light-DOM parent.
The CSS-wide keywords work on every property, and in all:
inherit: use the parent's computed value, even for a property that doesn't normally inherit (border: inherit).initial: the property's initial value from the spec. It is not the browser's default for that element:display: initialon a<div>givesinline.unset:inheritfor inherited properties,initialfor the rest. It's what the property would do with no declaration.revert: roll back to the previous origin. In author CSS that means "as if no author rule set this", so it falls back to user styles and then the UA style sheet:display: reverton a<div>givesblock.revert-layer: roll back to the previous cascade layer, as if this layer had no rule for the property. With no lower layer in the origin, it acts likerevert.
all resets every property except direction and unicode-bidi, and doesn't touch custom properties. all: revert gives back the browser's styling; all: unset strips it.
Inheritance passes the computed value, which is why line-height: 1.5 and line-height: 150% behave differently: the number is inherited as a number, the percentage as the parent's resolved length.