Layout
Utilities for controlling the display box type of an element.
Class | Styles |
---|---|
block | display: block; |
inline-block | display: inline-block; |
inline | display: inline; |
flex | display: flex; |
inline-flex | display: inline-flex; |
table | display: table; |
inline-table | display: inline-table; |
table-caption | display: table-caption; |
table-cell | display: table-cell; |
table-column | display: table-column; |
table-column-group | display: table-column-group; |
table-footer-group | display: table-footer-group; |
table-header-group | display: table-header-group; |
table-row-group | display: table-row-group; |
table-row | display: table-row; |
flow-root | display: flow-root; |
grid | display: grid; |
inline-grid | display: inline-grid; |
contents | display: contents; |
list-item | display: list-item; |
hidden | display: none; |
Use the inline
, inline-block
, and block
utilities to control the flow of text and elements.
Use the flow-root
utility to create a block-level element with its own block formatting context.
Use the flex
utility to create a block-level flex container.
Use the inline-flex
utility to create an inline flex container that flows with text.
Use the grid
utility to create a grid container.
Use the inline-grid
utility to create an inline grid container.
Use the contents
utility to create a "phantom" container whose children act like direct children of the parent.
Use the table
, table-row
, table-cell
, table-caption
, table-column
, table-column-group
, table-header-group
, table-row-group
, and table-footer-group
utilities to create elements that behave like their respective table elements.
Use the hidden
utility to set an element to display: none
and remove it from the page layout (compare with invisible
from the visibility documentation).
Prefix a display
utility with a breakpoint variant like md:
to only apply the utility at medium screen sizes and above:
<div class="flex md:inline-flex"> <!-- ... --></div>
Learn more about using variants in the variants documentation.