CSS Display Property Reference

All CSS display values including block, inline, flex, grid, contents and none.

Reference for CSS display property values with outer display type, inner display type and legacy shorthands, plus a resolver that maps each legacy keyword to its two-value equivalent.

What are outer and inner display types?

Modern CSS splits display into two parts: the outer type controls how the box participates in its parent's layout (block or inline), and the inner type controls how its own children are laid out (flow, flex, grid, table). display: flex is shorthand for display: block flex.

What box an element generates

The display property is the single most important layout switch in CSS: it decides whether an element is a block or inline box and which layout model (flow, flex, grid, table) governs its children. Modern CSS reframes every value as an outer plus inner display type, which makes the once-mysterious keywords much clearer. This reference lists the common values with their outer/inner types and a resolver that expands each legacy keyword.

How it works

A legacy single keyword maps to an outer + inner pair:

display: block;         /* = block flow      */
display: inline-block;  /* = inline flow-root */
display: flex;          /* = block flex      */
display: inline-grid;   /* = inline grid     */

The outer type (block or inline) sets how the box itself flows among its siblings; the inner type sets the formatting context for its children. flow-root is special: it establishes a new block formatting context, which is why inline-block (inline flow-root) sizes like a block. The box-generation values stand apart: list-item adds a ::marker, contents makes the box itself disappear while keeping its children, and none removes the whole subtree from layout and the accessibility tree.

Tips and notes

  • display: flex/grid only changes the children’s layout, not the element’s outer flow.
  • Use flow-root (or inline-block) to contain floats without an empty clearfix element.
  • contents is powerful for unwrapping, but audit accessibility — it drops the box from the a11y tree.
  • nonevisibility: hidden: none removes space, hidden keeps it.