CSS Display 3 splits display into two independent questions:
- Outer display type: how the element's principal box participates in its parent's flow layout.
blockboxes stack in the block direction and, withwidth: auto, fill the container's inline size;inlineboxes sit on lines with text. - Inner display type: which formatting context lays out its children:
flow(normal block and inline layout),flow-root(flow, but always a new block formatting context),flex,grid,table, orruby.
The one-word values everyone knows are shorthands for pairs. block is block flow, inline is inline flow, flex is block flex, inline-block is inline flow-root, inline-grid is inline grid. The two-keyword syntax is valid CSS (shipped in Chrome 115, Firefox 70 and Safari 15), but getComputedStyle() still serializes the short form.
Omit one half and it defaults: display: flow-root means block flow-root, and display: inline means inline flow. Adding list-item (list-item, inline list-item) also generates a ::marker box.
Two values generate no box: none drops the element and its whole subtree; contents drops only the element's own box and puts its children in its place. Neither changes the DOM, selector matching or inheritance.
The parent can override what you wrote. Blockification forces the outer type to block for flex and grid items, floats and absolutely positioned boxes, so a <span> inside a flex container computes to display: block. That's why width suddenly works on it.
display doesn't change semantics: a <ul> with display: flex is still a list. And a replaced element's inner display is outside CSS: display: flex on an <img> doesn't lay out anything inside it.