isolation CSS property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.

The isolation CSS property determines whether an element must create a new stacking context.

Try it

isolation: auto;
isolation: isolate;
<section class="default-example" id="default-example">
  <div class="background-container">
    <div id="example-element">
      <img src="../../../../../../shared-assets/images/examples/firefox-logo.svg">
      <p><code>mix-blend-mode: multiply;</code></p>
    </div>
  </div>
</section>
.background-container {
  background-color: #f4f460;
  width: 250px;
}

#example-element {
  border: 1px solid black;
  margin: 2em;
}

#example-element * {
  mix-blend-mode: multiply;
  color: #8245a3;
}

This property is especially helpful when used in conjunction with mix-blend-mode and z-index.

Syntax

css
/* Keyword values */
isolation: auto;
isolation: isolate;

/* Global values */
isolation: inherit;
isolation: initial;
isolation: revert;
isolation: revert-layer;
isolation: unset;

The isolation property is specified as one of the keyword values listed below.

Values

auto

A new stacking context is created only if one of the properties applied to the element requires it.

isolate

A new stacking context must be created.

Formal definition

Initial valueauto
Applies toAll elements. In SVG, it applies to container elements, graphics elements, and graphics referencing elements.
Inheritedno
Computed valueas specified
Animation typeNot animatable

Formal syntax

isolation = 
<isolation-mode>

<isolation-mode> =
auto |
isolate

Examples

Forcing a new stacking context for an element

HTML

html
<div class="big-square">
  <div class="isolation-auto">
    <div class="small-square">auto</div>
  </div>
  <div class="isolation-isolate">
    <div class="small-square">isolate</div>
  </div>
</div>

CSS

css
.isolation-auto {
  isolation: auto;
}

.isolation-isolate {
  isolation: isolate;
}

.big-square {
  background-color: lime;
  width: 200px;
  height: 210px;
}

.small-square {
  background-color: lime;
  width: 100px;
  height: 100px;
  border: 1px solid black;
  padding: 2px;
  mix-blend-mode: difference;
}

Result

Specifications

Specification
Compositing and Blending Module Level 2
# isolation

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
isolation
Chrome – Full support
Chrome 41 (Release date: 2015-03-03)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 36 (Release date: 2015-02-24)
footnote Full support
Opera – Full support
Opera 28 (Release date: 2015-03-10)
footnote Full support
Safari – Full support
Safari 8 (Release date: 2014-10-16)
footnote Full support
Chrome Android – Full support
Chrome Android 41 (Release date: 2015-03-11)
footnote Full support
Firefox for Android – Full support
Firefox for Android 36 (Release date: 2015-02-27)
footnote Full support
Opera Android – Full support
Opera Android 28 (Release date: 2015-03-10)
footnote Full support
Safari on iOS – Full support
Safari on iOS 8 (Release date: 2014-09-17)
footnote Full support
Samsung Internet – Full support
Samsung Internet 4 (Release date: 2016-03-11)
footnote Full support
WebView Android – Full support
WebView Android 41 (Release date: 2015-03-11)
footnote Full support
WebView on iOS – Full support
WebView on iOS 8 (Release date: 2014-09-17)
footnote Full support
auto
Chrome – Full support
Chrome 41 (Release date: 2015-03-03)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 36 (Release date: 2015-02-24)
footnote Full support
Opera – Full support
Opera 28 (Release date: 2015-03-10)
footnote Full support
Safari – Full support
Safari 8 (Release date: 2014-10-16)
footnote Full support
Chrome Android – Full support
Chrome Android 41 (Release date: 2015-03-11)
footnote Full support
Firefox for Android – Full support
Firefox for Android 36 (Release date: 2015-02-27)
footnote Full support
Opera Android – Full support
Opera Android 28 (Release date: 2015-03-10)
footnote Full support
Safari on iOS – Full support
Safari on iOS 8 (Release date: 2014-09-17)
footnote Full support
Samsung Internet – Full support
Samsung Internet 4 (Release date: 2016-03-11)
footnote Full support
WebView Android – Full support
WebView Android 41 (Release date: 2015-03-11)
footnote Full support
WebView on iOS – Full support
WebView on iOS 8 (Release date: 2014-09-17)
footnote Full support
isolate
Chrome – Full support
Chrome 41 (Release date: 2015-03-03)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 36 (Release date: 2015-02-24)
footnote Full support
Opera – Full support
Opera 28 (Release date: 2015-03-10)
footnote Full support
Safari – Full support
Safari 8 (Release date: 2014-10-16)
footnote Full support
Chrome Android – Full support
Chrome Android 41 (Release date: 2015-03-11)
footnote Full support
Firefox for Android – Full support
Firefox for Android 36 (Release date: 2015-02-27)
footnote Full support
Opera Android – Full support
Opera Android 28 (Release date: 2015-03-10)
footnote Full support
Safari on iOS – Full support
Safari on iOS 8 (Release date: 2014-09-17)
footnote Full support
Samsung Internet – Full support
Samsung Internet 4 (Release date: 2016-03-11)
footnote Full support
WebView Android – Full support
WebView Android 41 (Release date: 2015-03-11)
footnote Full support
WebView on iOS – Full support
WebView on iOS 8 (Release date: 2014-09-17)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

See also