CSS <display-inside> Data Type
The <display-inside> data type is the inner display type, which sets how an element lays out its children: flow, flow-root, table, flex, grid or ruby.
Description
The <display-inside> CSS data type represents the keywords that set an element's inner display type: the layout model the element uses for its own children. It is one half of the two-value syntax of the display property, together with <display-outside>, which sets how the element itself sits in its parent.
flow lays children out in normal flow, as blocks and lines of text. flow-root does the same but also creates a new block formatting context, which contains floats and prevents margins collapsing through the element. flex and grid turn the element into a flex or grid container. table makes it behave like an HTML table, ruby like a ruby annotation, and math lays out MathML content.
If only an inner keyword is given, the outer type defaults to block, except for ruby, which defaults to inline. So display: flex is the same as display: block flex, and display: inline grid is the same as the older inline-grid.
Examples:
.nav { display: flex; } /* block flex */
.gallery { display: grid; } /* block grid */
.chip { display: inline flex; } /* inline-flex */
.clearfix { display: flow-root; } /* contains floats */
Interactive Demo
Text after the box.
Syntax
<display-inside> = flow | flow-root | table | flex | grid | ruby | math
Values
- flowLays out children using normal flow: block and inline layout.
- flow-rootNormal flow inside a new block formatting context, which contains floats and stops margin collapsing.
- tableThe element behaves like an HTML table element.
- flexThe element is a flex container and lays out its children with flexbox.
- gridThe element is a grid container and lays out its children with CSS grid.
- rubyThe element behaves like an HTML ruby element, for annotating text.
- mathThe element lays out MathML content (used for the math element).
Example
Browser Support
The following information will show you the current browser support for the CSS display-inside data type. Hover over a browser icon to see the version that first introduced support for this CSS data type.
Desktop





Tablets & Mobile





