CSS isolation Property

Beginner
5 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The isolation property decides whether an element must create a new stacking context. With isolate, it always does. With auto (the default), a stacking context appears only if another property on that element requires one.

It is most useful with mix-blend-mode: put isolation: isolate on a wrapper so children blend inside the group instead of with content behind it. It also matters for z-index ordering inside that context. It applies to all elements, is not inherited, and is not animatable.

Standard-track.

Not deprecated and not experimental. Widely available across modern browsers since 2020 (Baseline high since 2022).

CSS Syntax

syntax.css
isolation: auto | isolate | initial | inherit;

Only two keywords matter in practice: auto and isolate.

Property Values

ValueDescriptionTry it
autoDefault. Create a stacking context only if another property needs oneTry it
isolateAlways create a new stacking contextTry it
initialResets to autoTry it
inheritTakes the parent's isolation (not inherited by default)Try it

How to Use isolation

Wrap blended content, then force a stacking context when you need to contain the blend.

  1. Build the visual group (background + children that use mix-blend-mode).
  2. Put those children inside a wrapper.
  3. Set isolation: isolate on the wrapper to contain blending—or leave auto if blending with the backdrop is intentional.
  4. Check the result against the parent background; switch between auto and isolate to see the difference.
PieceRequired?Role
WrapperYes (for containment)The element that gets isolation
mix-blend-modeCommon use caseShows the effect clearly when toggling isolate
isolationOptionalDefaults to auto

Live Preview

Same lime background and mix-blend-mode: difference square. Toggle isolation on the wrapper.

auto often blends with the green stage; isolate keeps blending inside the wrapper.

Result
blend

isolation: auto

CSS Examples

Each snippet keeps only what isolation needs. Use Try It Yourself for a live editor.

Example 1 — auto (Default)

Blending can interact with the parent background when the wrapper stays auto.

CSS
<style>
  .bg { background: lime; padding: 2em; }
  .wrap { isolation: auto; }
  .box {
    background: lime;
    mix-blend-mode: difference;
    width: 100px;
    height: 100px;
  }
</style>

<div class="bg">
  <div class="wrap">
    <div class="box">auto</div>
  </div>
</div>
Try It Yourself

How It Works

  1. Colored stage. The outer background is lime.
  2. Leave isolation default. isolation: auto does not force a new stacking context by itself.
  3. Apply a blend. mix-blend-mode: difference on the child mixes with what is behind it.
  4. Result. The square’s look depends on the backdrop outside the wrapper.

Example 2 — isolate

Force a stacking context so blending stays inside the group.

CSS
<style>
  .bg { background: lime; padding: 2em; }
  .wrap { isolation: isolate; }
  .box {
    background: lime;
    mix-blend-mode: difference;
    width: 100px;
    height: 100px;
  }
</style>

<div class="bg">
  <div class="wrap">
    <div class="box">isolate</div>
  </div>
</div>
Try It Yourself

How It Works

  1. Same markup. Only the isolation keyword changes.
  2. Force a context. isolation: isolate creates a new stacking context on the wrapper.
  3. Contain the blend. The child still uses mix-blend-mode, but it blends within that group.
  4. When to use it. Cards, badges, or overlays where you do not want accidental blending with page chrome.

Example 3 — Compare auto and isolate

Two wrappers, same blend—only isolation differs.

CSS
<style>
  .bg { background: lime; padding: 1em; }
  .auto { isolation: auto; }
  .isolate { isolation: isolate; }
  .box {
    background: lime;
    mix-blend-mode: difference;
    width: 80px;
    height: 80px;
  }
</style>

<div class="bg">
  <div class="auto"><div class="box">auto</div></div>
  <div class="isolate"><div class="box">isolate</div></div>
</div>
Try It Yourself

How It Works

  1. Shared blend. Both squares use the same mix-blend-mode.
  2. One keyword each. auto vs isolate is the only difference that matters.
  3. Read the colors. The isolated group usually looks different from the open backdrop blend.
  4. Study tip. Keep backgrounds simple (one flat color) so the change is obvious.

Edge Cases & Pitfalls

If nothing seems to change, you may already have a stacking context from another property.

blend

Hard to see without blending

Alone, isolation does not move or resize boxes. Pair it with mix-blend-mode (or inspect stacking) to notice the difference.

other

Other properties also create contexts

opacity less than 1, transform, filter, and some z-index cases already create stacking contexts. isolate is the explicit switch.

z

z-index is scoped

Inside an isolated element, z-index values compete within that context first. Children cannot “escape” above siblings of the isolated ancestor as easily.

bg

Not the same as background-blend-mode

background-blend-mode blends layers of one element’s backgrounds. isolation + mix-blend-mode is about element compositing and stacking contexts.

auto

auto is not “never isolate”

If the element already needs a stacking context for another reason, you still get one under auto. Use isolate when you want that guarantee on purpose.

Browser Support

isolation is a browser layout / compositing property. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available since 2020

isolation

Chrome 41+, Firefox 36+, Safari 8+, Edge 79+. Internet Explorer has no support.

97% modern browsers
Google Chrome 41+
Full support
Mozilla Firefox 36+
Full support
Apple Safari 8+
Full support
Microsoft Edge 79+
Full support
Opera 28+
Full support
Samsung Internet 4.0+
Full support
Internet Explorer No support
None
isolation Widely supported

Bottom line: Safe for modern sites. Pair with mix-blend-mode when teaching or debugging stacking and blend containment.

Key Takeaways

  • Role: controls whether an element must create a stacking context.
  • Values: auto (default) or isolate (always).
  • Best with: mix-blend-mode to contain or allow backdrop blending.
  • Not layout: does not change size or flow—only stacking / compositing.

One line: isolation: isolate forces a stacking context so blends and z-index stay grouped; auto leaves that to other properties.

Frequently Asked Questions

isolation controls whether an element must create a new stacking context. isolate forces one; auto creates one only when another property requires it.
The initial value is auto. A stacking context appears only if something else on the element needs one.
Use isolate when you want to contain mix-blend-mode (or related blending) so children blend inside a group instead of with content behind the group.
With auto, a child's mix-blend-mode can blend with the backdrop outside the wrapper. With isolate on the wrapper, blending stays inside that stacking context.
No. It affects stacking and compositing, not width, height, or flow layout.
Chrome 41+, Firefox 36+, Safari 8+, and Edge 79+. Internet Explorer has no support. It is a browser layout property, not a Node.js feature.

Next: justify-content

Align flex or grid items along the main axis.

justify-content tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful