Favorites

CSS <display-outside> Data Type

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

The <display-outside> data type is the outer display type, which sets how an element takes part in its parent's layout: block, inline or run-in.

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-outside> CSS data type represents the keywords that set an element's outer display type: how the element's box takes part in the layout of its parent. It is one half of the two-value syntax of the display property, the other half being <display-inside>, which sets how the element lays out its own children.

There are three keywords. block makes the box start on a new line and, by default, fill the available width, like a paragraph or div. inline makes the box flow within a line of text, sitting next to neighbouring words and inline elements, like a span. run-in was intended to merge a box into the start of the following block, but it is not supported in current browsers.

Familiar single-keyword values are shorthands for a combination of outer and inner types. For example, display: block is display: block flow, display: inline-block is display: inline flow-root, and display: inline-flex is display: inline flex. If only an outer keyword is given, the inner type defaults to flow.

Examples:

/* Single-keyword syntax */
.card  { display: block; }
.badge { display: inline; }

/* Two-value syntax: outer + inner */
.toolbar { display: inline flex; }   /* same as inline-flex */
.panel   { display: block grid; }    /* same as grid */

Interactive Demo

Text before the span and text after it, which wraps onto the next line.

Demo Code
HTML Code
<p class="demo-text">Text before <span class="demo-element">the span</span> and text after it, which wraps onto the next line.</p>
CSS Code
.demo-text {
	width: 290px;
	margin: 0;
	line-height: 1.8;
	color: #1b1f3b;
}
.demo-element {
	width: 150px;
	padding: 4px 8px;
	background: #ffe5f1;
	border: 2px solid #f72585;
	display: inline;
}

Syntax

<display-outside> = block | inline | run-in

Values

  • blockThe element generates a block box, which starts on a new line and creates line breaks before and after it in normal flow.
  • inlineThe element generates one or more inline boxes that flow with the surrounding text, without line breaks before or after.
  • run-inThe element generates a run-in box that merges into the following block. Not supported in current browsers.

Example

<div class="wrap">
<h1>CSS &lt;display-outside&gt; examples</h1>
<div class="grid">
<div class="card">
<div class="demo blk">Text <span class="item">one</span> <span class="item">two</span> text</div>
<div class="label">display: block</div>
</div>
<div class="card">
<div class="demo inl">Text <span class="item">one</span> <span class="item">two</span> text</div>
<div class="label">display: inline</div>
</div>
<div class="card">
<div class="demo inl-flex">Text <span class="item">one</span> <span class="item">two</span> text</div>
<div class="label">display: inline flex</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;
}

.blk .item { display: block; }
.inl .item { display: inline; }
.inl-flex .item { display: inline flex; gap: 4px; }
Open in editor

Browser Support

The following information will show you the current browser support for the CSS display-outside 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.