Favorites

CSS <display-listitem> Data Type

<display-listitem>
CSS Data TypeThis data type is supported by all modern browsers.
Updated 21st November 2026

The <display-listitem> data type is the list-item display keyword, which gives an element a list marker, optionally with an outer and inner display type.

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.

Description

The <display-listitem> CSS data type represents the list-item keyword of the display property, optionally combined with an outer and an inner display type. An element with display: list-item behaves like an HTML li element: it generates a ::marker pseudo-element, such as a bullet or a number, and it automatically increments the built-in list-item counter used for ordered list numbering.

The full syntax is list-item plus up to two optional keywords: an outer type (block or inline) and an inner type (flow or flow-root). The defaults are block and flow, so display: list-item is the same as display: block flow list-item. display: inline list-item creates an inline element that still shows a marker.

The marker's appearance is controlled with list-style-type, list-style-position and list-style-image, and it can be styled directly with the ::marker pseudo-element.

Examples:

/* Turn any element into a list item with a bullet */
.step {
  display: list-item;
  list-style-type: disc;
  margin-left: 1.5em;
}

/* Inline list item */
.tag {
  display: inline list-item;
  list-style: square inside;
}

Syntax

<display-listitem> = <display-outside>? && [ flow | flow-root ]? && list-item

Values

  • list-itemRequired. The element generates a ::marker box and increments the list-item counter.
  • <display-outside>Optional. block (default) or inline.
  • flow | flow-rootOptional. The inner display type; defaults to flow.

Example

<div class="wrap">
<h1>CSS &lt;display-listitem&gt; examples</h1>
<div class="grid">
<div class="card">
<div class="demo">
<div class="li">A div with display: list-item</div>
<div class="li square">With a square marker</div>
</div>
<div class="label">display: list-item</div>
</div>
<div class="card">
<div class="demo" style="counter-reset: list-item">
<div class="li num">First</div>
<div class="li num">Second</div>
<div class="li num">Third</div>
</div>
<div class="label">list-style-type: decimal</div>
</div>
<div class="card">
<div class="demo"><span class="inline-li">One</span><span class="inline-li">Two</span></div>
<div class="label">display: inline list-item</div>
</div>
</div>
</div>
/* Base demo layout */
* { box-sizing: border-box; }

body {
  margin: 24px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background: #f5f7fb;
  color: #102a43;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
}

h1 {
  font-size: 20px;
  margin: 0 0 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(16, 42, 67, 0.08);
}

.label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 12px;
  color: #486581;
  margin-top: 10px;
  word-break: break-word;
}

.note {
  font-size: 13px;
  color: #486581;
  margin-top: 14px;
}

/*  examples */
.demo {
  padding: 10px;
  border-radius: 10px;
  border: 1px dashed #94a3b8;
  background: #fff;
}

.item {
  padding: 8px 10px;
  margin: 4px;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.li {
  display: list-item;
  margin-left: 22px;
  padding: 4px 0;
}

.li.square { list-style-type: square; }
.li.num { list-style-type: decimal; }

.li::marker {
  color: #2563eb;
  font-weight: 700;
}

.inline-li {
  display: inline list-item;
  list-style: "\2605  " inside;
  margin-right: 16px;
}
Open in editor

Browser Support

The following information will show you the current browser support for the CSS display-listitem data type. Hover over a browser icon to see the version that first introduced support for this CSS data type.

This data type is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.