On this page
display
Prev: layout | Up: layout | Next: `flex`
Rel: layout, Display & Layout Guide
Ref: MDN Web Docs — display
Tags: #public #web #css #properties #layout #tier/core
Syntax & Overview
display: block | inline | flex | grid | flow-root | none;
Controls an element's outer flow participation and inner formatting context.
- Initial:
inline| Inherited: No | Animatable: Discrete (allow-discrete)
Notes & Best Practices
- Sets outer + inner layout model:
flex(1D flow),grid(2D tracks),contents(removes box wrapper while keeping children in parent grid/flex),none(removes from layout AND accessibility tree).
Example
.stack { display: flex; flex-direction: column; gap: 1rem; }
.grid { display: grid; grid-template-columns: 16rem 1fr; }
Linked from
Related notes
- tuts/css/properties/layout/flex Linked here; links to this page; shared tags: #css, #layout, #properties, #tier, #web
- tuts/css/properties/layout Linked here; links to this page; shared tags: #css, #layout, #properties, #web
- tuts/css/properties/layout/float links to this page; shared tags: #css, #layout, #properties, #tier, #web
- tuts/css/properties/display_and_layout Linked here; shared tags: #css, #layout, #properties, #web
- tuts/html/elements/text/center links to this page; shared tags: #tier, #web
- tuts/html/elements/text links to this page; shared tags: #web
- tuts/css/properties/layout/align-items shared tags: #css, #layout, #properties, #tier, #web
- tuts/css/properties/layout/gap shared tags: #css, #layout, #properties, #tier, #web
- tuts/css/properties/layout/grid-template-columns shared tags: #css, #layout, #properties, #tier, #web
- tuts/css/properties/layout/justify-content shared tags: #css, #layout, #properties, #tier, #web