designwithfocus

CSS

CSS Display Types: Outer Role and Inner Layout

By Design With Focus Team 7 min read
Boxes arranged as a stack, a row, and a two-column grid

Short answer

CSS display types set whether an element is a block or inline box and which layout its children use, such as flow, flex, or grid. MDN splits that into an outer type and an inner type. The property's initial value is inline, and it is not inherited. MDN marks display Baseline Widely available since July 2015, with an asterisk that some parts vary.

Last verified against the sources listed below.

Key takeaways

  • Outer display is the element's role in flow. Inner display is how the children are laid out.
  • A lone outer value such as block implies an inner value of flow.
  • A lone inner value such as flex implies an outer value of block, except ruby, which stays inline.
  • none removes the element and its descendants from layout. contents does not generate its own box.
  • The CSS initial value is inline. HTML still expects div and p to be display: block.
  • inline-flex is the legacy spelling of inline flex. The same pairing exists for grid and table.

CSS display types are the values of the display property, and they decide the element’s own box plus the layout of its children. MDN’s display page says the property sets whether the element is treated as a block or inline box, and the layout used for its children, such as flow, grid, or flex.

CSS is the language the property belongs to. The page was last modified on September 21, 2026. As of December 2026, the support banner says the feature has been available across browsers since July 2015, with an asterisk that some parts vary.

What do outer and inner display mean?

Outer display is how the element participates in flow. Inner display is the formatting context for its children. MDN says that in one sentence, and the Display Level 3 draft of 5 June 2026 defines the two qualities the same way.

If you set only an outer value, such as block or inline, the inner value defaults to flow. If you set only an inner value, such as flex or grid, the outer value defaults to block. The exception MDN names is ruby, which defaults to inline. list-item with no inner value defaults to flow, and with no outer value the principal box is block.

The Level 4 editor’s draft, also dated 5 June 2026, is the draft MDN cites for the latest formal syntax, along with Grid Level 3 and MathML Core. MDN says not every browser has implemented every part of that syntax.

Which values does MDN print?

The table uses the groupings on the MDN page. Effects are shortened from that page’s descriptions. run-in and math appear in the formal syntax and are not given their own paragraphs in the grouping section read here.

Value Group on the MDN page What that page says
block Outside A block box, with line breaks before and after in normal flow
inline Outside Inline boxes, no line breaks before or after. The next item can sit on the same line
flow Inside Block-and-inline layout. Outer inline can yield an inline box
flow-root Inside A block box that starts a new block formatting context
table Inside Behaves like a table element. Defines a block-level box
flex Inside Block-level box, children use the flexbox model
grid Inside Block-level box, children use the grid model
grid-lanes Inside Block-level grid lanes. Columns come from grid-template-columns. Items pack on the block axis
ruby Inside Inline-level box, ruby formatting model
list-item List item A block box for the content and a separate marker box
table-row-group Internal Like tbody
table-header-group Internal Like thead
table-footer-group Internal Like tfoot
table-row Internal Like tr
table-cell Internal Like td
table-column-group Internal Like colgroup
table-column Internal Like col
table-caption Internal Like caption
ruby-base Internal Like rb
ruby-text Internal Like rt
ruby-base-container Internal Generated as anonymous boxes
ruby-text-container Internal Like rtc
contents Box No box of its own. Children show in its place
none Box Removed from layout, and so are the descendants
inline-block Legacy Equivalent to inline flow-root
inline-table Legacy Equivalent to inline table
inline-flex Legacy Equivalent to inline flex
inline-grid Legacy Equivalent to inline grid
inline-grid-lanes Legacy Equivalent to inline grid-lanes
run-in Formal syntax Printed as an outer keyword beside block and inline
math Formal syntax Printed beside the inner keywords in the Level 4 grammar note
inherit, initial, revert, revert-layer, unset Global The usual CSS-wide keywords. initial computes as inline

Two-keyword forms MDN also prints include block flow, inline flow, block flex, inline flex, block grid, inline grid, block table, inline table, and the list-item combinations block flow list-item and inline flow list-item.

How do the legacy names map?

The single keywords from CSS 2 are kept so older style sheets still parse. MDN’s comparison list is the map.

Short value Two-keyword equivalent
block block flow
inline inline flow
flow block flow
flow-root block flow-root
flex block flex
grid block grid
table block table
list-item block flow list-item
inline-block inline flow-root
inline-flex inline flex
inline-grid inline grid
inline-table inline table

grid-lanes is the newer inner value. MDN says columns follow grid-template-columns and items pack in the block direction to fill gaps. inline-grid-lanes uses grid-template-rows and packs in the inline direction. Those two are not in the short map above because the page explains them on their own.

A shadow only paints if the element generates a box. The box shadow generator writes a box-shadow rule. display: none removes the box, so the shadow goes with it. contents also skips the element’s own box.

What does the HTML stylesheet set?

The CSS initial value and the HTML expected value are different facts. MDN’s formal definition says display starts at inline and is not inherited. The HTML rendering section expects this set to be display: block: address, blockquote, center, dialog, div, figure, figcaption, footer, form, header, hr, legend, listing, main, p, plaintext, pre, search, and xmp.

A closed dialog is a separate rule on that page: dialog:not([open]) is expected to be display: none. A select rendered as a list box is expected to be inline-block. Those are HTML’s expected rules for particular elements. They are not extra values of the CSS property.

Display Level 3 adds a warning that belongs with this: the property does not change an element’s semantics. The document language defines those. none is the value that also affects whether the element is interactive and whether it is spoken.

Changing a table to block, grid, or flex can, in some browsers, change how the table is exposed in the accessibility tree. MDN says the table may no longer be announced properly.

Which mistakes show up in real style sheets?

Setting display: block on a div repeats the HTML expected rule. It is harmless, and it is not what creates a flex or grid formatting context. The inner value is still flow unless you change it.

Using none to hide a control that must stay available to a screen reader fights the accessibility note above. The element leaves the accessibility tree. MDN points at other properties when the goal is visual hiding only.

Assuming every keyword in the formal syntax shipped in July 2015 over-reads the banner. The banner dates the property. The asterisk, and the note about Level 4, Grid Level 3, and MathML Core, are how MDN says the newer pieces can lag. math and grid-lanes are the ones to check before you depend on them.

Animation is a separate corner. MDN says display animates as a discrete type, flipping halfway, except when the other value is none. In that case the visible value is used for the whole duration, so an exit can fade with opacity instead of vanishing on the first frame.

Transitions need @starting-style and transition-behavior: allow-discrete before that flip will run. Those are the conditions on the page, not a claim that every browser animates every keyword.

Frequently asked questions

What is the difference between outer and inner display?

MDN says the outer type is the element's role in flow layout, and the inner type is the layout of its children. The CSS Display Module Level 3 candidate draft, 5 June 2026, uses the same split. The inner type, for a non-replaced element, is the formatting context that dictates how descendant boxes are laid out. The outer type dictates how the principal box participates in flow. Text sequences have no display type. Replaced elements are outside the inner-display rules.

Why does a div look like a block if the initial value is inline?

MDN's formal definition lists the initial value as inline, and the property is not inherited. The HTML standard's rendering section is a separate stylesheet. It expects address, blockquote, div, figure, footer, form, header, main, p, and several other elements to use display: block. A div looks like a block because that expected rule sets it, not because the CSS initial value changed. An element with no such rule, and no author rule, stays at the initial inline.

Is inline-flex different from inline flex?

MDN says no. inline-flex is the legacy single keyword, and it is equivalent to inline flex. The same page pairs inline-block with inline flow-root, inline-table with inline table, inline-grid with inline grid, and inline-grid-lanes with inline grid-lanes. block, flex, and grid alone are the short forms of block flow, block flex, and block grid. You can put the single keyword first as a fallback, then the two-keyword form, for older parsers.

What does display: none do to a screen reader?

MDN says none removes the element from the accessibility tree, so the element and its descendants are not announced. If you only want to hide something visually and keep it available to assistive technology, MDN says to use a different combination of properties. It also says some browsers remove an element with display: contents from the accessibility tree even though descendants remain, and that this disagrees with the CSS specification. none is not a polite visual hide.

Do all of the new keywords work everywhere?

MDN says display has been available across browsers since July 2015, and that some parts have varying support. The formal syntax note says the grammar reflects CSS Display Module Level 4, CSS Grid Layout Module Level 3, and MathML Core, and that not every browser has implemented every part. grid-lanes and the math keyword are in that syntax. Treat the July 2015 date as the long-standing core, and check the compatibility table before you ship a newer keyword.

Sources