descriptor
@property/inherits — CSS reference
This mandatory descriptor determines default inheritance. With false, a child without a declaration receives the registered initial value. With true it receives its parent’s computed value. Explicit CSS-wide inheritance remains possible.
Formal Syntax & Structure
css syntaxcss
inherits: true | false;Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS substitution lab</title><style>body {margin:0} .sample {height:12px;background:#006050}#parent {width:300px} .sample {width:40px;height:30px;margin-bottom:4px;color:white}@property --yes{syntax:"<length>";inherits:true;initial-value:10px} @property --no{syntax:"<length>";inherits:false;initial-value:10px} #parent{--yes:70px;--no:70px} #a{width:var(--yes)} #b{width:var(--no)}</style><body><div id="parent"><div id="a" class="sample">A</div><div id="b" class="sample">B</div></div></body></html>