data-type

<display-box> — CSS reference

Grammar category for values that suppress principal box generation. None suppresses the subtree; contents normally suppresses the wrapper while preserving descendant layout. Unusual elements may have special box-generation rules.

Formal Syntax & Structure

css syntaxcss
contents | none

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS flow layout lab</title><style>body {margin:0} .sample {background:#dcebe9;color:#182e32}body{font:16px/20px sans-serif} #p{width:240px;background:#e6eef2} .tile{background:#c2e4d5} #a,#b{box-sizing:content-box}#a{display:contents}#b{display:none}</style><body><div id="p"><div id="a"><span id="c">Kept</span></div><div id="b"><span id="d">Hidden</span></div></div></body></html>
CSS Reference