CSS: Display Property

By Xah Lee. Date: . Last updated: .

CSS display property lets you control layout.

It is one of the most powerful property for layout, but is complex to understand.

Here's the basics.

There are 2 major types of “rendering box” for a HTML element:

Simple Example

Here's a example of changing list items as inline.

Here's a list, without style:


Here's the same list, but each li set to display:inline:

<li style="display:inline">one</li>
<li style="display:inline">two</li>
<li style="display:inline">three</li>

What's Rendering Box Type?

The details are fairly complex, but basically it's like this.

Each element, has a “rendering box type”.

The “rendering box type” determines 2 things:

  1. How it is positioned with respect to its neighbor elements. example: block level (like a paragraph p), inline (like a bold b word in a sentence.), table (like block but width does not span the window width, it's shrink wrapped to the table's content's width, which is automatically computed by default.), and others.
  2. How it is children elements behave. example: table, ul (list), their child elements all have special type of rendering box.

Display Property Values

Here's complete list of values for display.

⭐ means it's not widely supported by browsers yet.


These controls their layout with respect to neighbor elements.



These controls the layout of their child elements.

display-outside and display-inside




Universal CSS Property Values

Liket it? I spend 2 years writing this tutorial. Help me spread it. Tell your friends. Or, Put $5 at patreon.

Or, Buy JavaScript in Depth

If you have a question, put $5 at patreon and message me.

Web Dev Tutorials

  1. HTML
  2. Visual CSS
  3. JS in Depth
  4. JS Object Ref
  5. DOM Scripting
  6. SVG
  7. Blog