- inline: Using this we can display any block-level element as an inline element. The height and width attribute values of the element will not affect.
- block: using this, we can display any inline element as a block-level element.
- inline-block: This property is similar to inline, except by using the display as inline-block, we can actually format the element using height and width values.
- flex: It displays the container and element as a flexible structure. It follows flexbox property.
- inline-flex: It displays the flex container as an inline element while its content follows the flexbox properties.
- grid: It displays the HTML elements as a grid container.
- none: Using this property we can hide the HTML element.
Below are some of the display types which are rarely used:
- table
- inline-table
- table-cell
- table-column
- table-row
- inline-grid
- list-item
- inherit
- initial
- table-caption
display: block : Elements with a display type of block are commonly called block-level elements and always start on a new line. They also take up the full width that they can (the equivalent of width: 100% )
display: inline : The inline display type does not create a new line, and only takes up as much width as it needs.
display: none : display type of none makes it disappear completely from the page. No space is left for it, and other elements are positioned as if it were not there.
display-inside
These keywords specify the element’s inner display type, which defines the type of formatting context that its contents are laid out in (assuming it is a non-replaced element):
flow
The element lays out its contents using flow layout (block-and-inline layout).
If its outer display type is inline or run-in, and it is participating in a block or inline formatting context, then it generates an inline box. Otherwise it generates a block container box.
Depending on the value of other properties (such as position ,float or overflow and whether it is itself participating in a block or inline formatting context, it either establishes a new block formatting context (BFC) for its contents or integrates its contents into its parent formatting context.
flow-root
The element generates a block element box that establishes a new block formatting context defining where the formatting root lies.
table
These elements behave like HTML < table > elements. It defines a block-level box.
flex
The element behaves like a block element and lays out its content according to the flexbox model
grid
The element behaves like a block element and lays out its content according to the grid model
ruby
The element behaves like an inline element and lays out its content according to the ruby form