The display property sets whether an element is treated as a block or inline box, and which layout its children use — normal flow, flex, grid, or none.
Formally it sets an outer type (role in flow) and an inner type (how children lay out). Everyday keywords such as flex mean block flex. The property is not inherited.
Baseline · Widely available.
Not deprecated. Core values work across modern browsers. Some newer keywords have limited support.
Experimental grid-lanes
grid-lanes / inline-grid-lanes are newer layout modes. Skip them until you need them and check browser support.
If layout or accessibility looks wrong, check these first.
a11y
display: none removes from the accessibility tree
Screen readers skip the element and its descendants. Do not use none for content that must still be announced.
contents
display: contents has accessibility caveats
Some browsers incorrectly drop the element itself from the accessibility tree. Prefer simpler markup when semantics matter.
tables
Changing table display can break announcements
Setting a table to block, flex, or grid can change how assistive tech exposes it. Keep real tables as tables when possible.
inline
Width and height on pure inline
display: inline ignores width/height the way a block would. Switch to inline-block, block, or a replaced element.
flex/grid
Set display on the container
flex and grid apply to the parent. Children become items automatically — you do not set display: flex on every child.
Compatibility
Browser Support
display is a browser CSS property for layout. Node.js, Deno, and Bun do not apply it.
✓ Baseline · Widely available
display
Core keywords (block, inline, flex, grid, none) work in all modern browsers. Newer values such as grid-lanes are experimental.
98%Core value support
Google ChromeAll modern versions
Full support
Mozilla FirefoxAll modern versions
Full support
Apple SafariAll modern versions
Full support
Microsoft EdgeAll modern versions
Full support
OperaAll modern versions
Full support
Samsung InternetSupported
Full support
Internet ExplorerLegacy keywords; no modern grid
Partial
displayWidely supported
Bottom line: Safe for everyday layout keywords. Check support before relying on experimental values. It is not a runtime API.
Remember
Key Takeaways
Role: set the box type and the children's layout mode.
Common picks:block, inline, inline-block, flex, grid, none.
Not inherited. HTML tags already ship with useful defaults.
Hide carefully:none removes layout and accessibility exposure.
One line: use display to choose the box and the layout engine — flex and grid on the parent, not on every child.
Frequently Asked Questions
It sets how an element participates in layout (block or inline) and how its children are laid out (flow, flex, grid, and similar).
The CSS initial value is inline, but browsers set defaults per HTML tag. For example, div is block and span is inline in the user-agent stylesheet.
Block boxes start on a new line and stretch to the available width. Inline boxes flow with text and only take the width of their content.
Use it when items should sit in a line like text but still accept width, height, and vertical padding or margin like a block.
No. It stays in the document but generates no box, takes no space, and is removed from the accessibility tree. Prefer visibility or visually-hidden patterns when assistive tech still needs the content.
Core values are Baseline Widely available. Newer keywords such as grid-lanes are experimental. It is a browser CSS property, not a Node.js feature.