`<display-legacy>` CSS type
Baseline Widely available
This feature is well established and works across many devices and browser versions. It's been available across browsers since July 2015.
CSS 2 used a single-keyword syntax for the display property, requiring separate keywords for block-level and inline-level variants of the same layout mode. This page details those values.
Syntax
Valid <display-legacy> values:
-
inline-block -
The element generates a block element box that will be flowed with surrounding content as if it were a single inline box (behaving much like a replaced element would).
It is equivalent to
inline flow-root. -
inline-table -
The
inline-tablevalue does not have a direct mapping in HTML. It behaves like an HTML<table>element, but as an inline box, rather than a block-level box. Inside the table box is a block-level context.It is equivalent to
inline table. -
inline-flex -
The element behaves like an inline element and lays out its content according to the flexbox model.
It is equivalent to
inline flex. -
inline-grid -
The element behaves like an inline element and lays out its content according to the grid model.
It is equivalent to
inline grid.
Formal syntax
<display-legacy> =
inline-block |
inline-list-item |
inline-table |
inline-flex |
inline-grid
Examples
In the below example, we are creating an inline flex container with the legacy keyword inline-flex.
HTML
<div class="container"> <div>Flex Item</div> <div>Flex Item</div> </div> Not a flex item
CSS
.container {
display: inline-flex;
}
Result
In the new syntax the inline flex container would be created using two values, inline for the outer display type, and flex for the inner display type.
.container {
display: inline flex;
}
Specifications
| Specification |
|---|
| CSS Display Module Level 3 # typedef-display-legacy |
Browser compatibility
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on iOS | Samsung Internet | WebView Android | WebView on iOS | |
inline-block |
1 |
12 |
1 |
7 |
1 |
18 |
4 |
14 |
1 |
1.0 |
4.4 |
1 |
inline-table |
1 |
12 |
3 |
7 |
1 |
18 |
4 |
14 |
1 |
1.0 |
4.4 |
1 |
inline-flex |
29
21
|
12 |
20Firefox 28 added multi-line flexbox support. |
16
15
|
9
7
|
29
25
|
20Firefox for Android 28 added multi-line flexbox support. |
16
14
|
9
7
|
2.0
1.5
|
4.4
4.4
|
9
7
|
inline-grid |
57 |
16
12
|
52 |
44 |
10.1 |
57 |
52 |
43 |
10.3 |
6.0Samsung Browser added this earlier than the corresponding Chrome version would indicate. |
57 |
10.3 |
See also
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/display-legacy