property
display — CSS reference
Controls box generation and the relationship between a box and its contents. Initial inline; not inherited. A block-level flex container is a block in its parent but uses flex layout internally. HTML user-agent rules commonly override the initial value. Changing display can change layout and, for some values, accessibility semantics.
Formal Syntax & Structure
css syntaxcss
[ <display-outside> || <display-inside> ] | <display-listitem> | <display-internal> | <display-box> | <display-legacy>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}#p{display:block flex;gap:10px}#a,#b{width:70px;height:30px}</style><body><div id="p"><div class="tile" id="a">First</div><div class="tile" id="b">Second</div></div></body></html>