The isolation property controls whether an element creates a new stacking context. Use it to keep child layers predictable and prevent unexpected overlap with the rest of the page.
01
Stacking
Layer control.
02
auto
Default value.
03
isolate
Force new context.
04
z-index
Related concept.
05
Blend Modes
Common pairing.
06
Components
UI wrappers.
Fundamentals
Introduction
The isolation property in CSS determines whether an element should create a new stacking context. Stacking contexts control how overlapping elements are painted and how z-index values compete with each other.
By controlling isolation, you can manage how elements overlap and interact visually within a layout, which helps prevent surprising layering bugs in complex interfaces.
Definition and Usage
Apply isolation: isolate on a wrapper when you want the element and its descendants to stack as one isolated group. This is especially helpful for components that use negative z-index, decorative backgrounds, or mix-blend-mode.
💡
Beginner Tip
Think of isolation: isolate as putting a component inside its own layer group. Child layers stay inside that group instead of leaking into the page behind it.
Foundation
📝 Syntax
The syntax for the isolation property accepts one of two keyword values:
The default value of the isolation property is auto. The browser creates a stacking context only when other properties such as z-index, opacity, transform, or filter require it.
Syntax Rules
Only two values: auto and isolate.
isolate always creates a new stacking context.
The property is not inherited.
Often paired with position: relative on component wrappers.
Useful with negative z-index and mix-blend-mode.
Cheat Sheet
⚡ Quick Reference
Question
Answer
Initial value
auto
Applies to
All elements
Inherited
No
Animatable
No
Common use
Component layer grouping
Reference
💎 Property Values
Value
Description
auto
The browser decides whether a new stacking context is needed. This is the default behavior.
isolate
Explicitly creates a new stacking context so the element and its descendants are isolated from outside layers.
Stacking Context
What Is a Stacking Context?
A stacking context is a group of elements that stack together as one unit relative to elements outside the group:
Without isolation — a child with z-index: -1 may render behind ancestor backgrounds or page content in unexpected ways.
With isolation: isolate — negative z-index children stay behind the wrapper’s own background but do not escape the component.
Blend modes — isolation limits mix-blend-mode blending to the component instead of the whole page.
🔄
Related Properties
Other properties can also create stacking contexts, including z-index, opacity below 1, transform, and filter. isolation: isolate gives you explicit control without changing those visuals.
Preview
👀 Live Preview
A card with isolation: isolate and a decorative ::before layer at z-index: -1:
Gradient stays inside
Hands-On
Examples Gallery
Contain negative z-index layers, limit blend modes, compare auto behavior, and wrap a component for predictable stacking.
🔢 Stacking Context Basics
See how isolation keeps internal layers from escaping a component.
Example 1 — Contain Negative z-index
Compare a card with isolation: isolate against one using the default auto value.
The glow sits behind the card content but remains part of the same isolated component layer group.
A11y
♿ Accessibility
Isolation does not replace contrast checks — layered backgrounds must still meet readability standards.
Avoid hiding focus outlines — negative z-index decorations should not cover focusable controls.
Test keyboard navigation — stacking changes should not trap or obscure interactive elements.
Do not rely on layering alone — screen readers follow DOM order, not visual stacking.
Keep decorative layers non-interactive — use aria-hidden="true" on purely visual glow elements.
🧠 How isolation Works
1
You set isolation on a wrapper
Apply isolation: isolate to the component that should own its own layer group.
CSS rule
2
A new stacking context is created
The browser groups the element and its descendants into one isolated stacking unit.
Stacking
3
Child layers compete inside the group
Negative z-index, blends, and overlays stay contained within the component.
Children
=
▦
Predictable component layering
Your UI stacks reliably without unexpected bleed into the page behind it.
Compatibility
🖥 Browser Compatibility
The isolation property is supported in modern browsers including Chrome 41+, Firefox 36+, Safari 8+, and Edge 79+.
✓ Baseline · Modern browsers
Stacking control in today’s browsers
All major browsers support isolation for explicit stacking context creation.
97%Modern browser support
Google Chrome41+ · Desktop & Mobile
Full support
Mozilla Firefox36+ · Desktop & Mobile
Full support
Apple Safari8+ · macOS & iOS
Full support
Microsoft Edge79+ · Chromium
Full support
Opera28+ · Modern versions
Full support
isolation property97% supported
Bottom line: Safe to use in modern projects. For very old browsers, test layered UI that depends on isolation.
Wrap Up
🎉 Conclusion
The isolation property is a valuable tool for managing stacking contexts and keeping component layers predictable. It helps you avoid unexpected overlaps when using negative z-index, decorative pseudo-elements, or blend modes.
For beginners, start with isolation: isolate on component wrappers that use internal background layers, then explore how it changes blending behavior in more advanced layouts.
Test layered cards, badges, and modals in real browsers
Prefer isolation over hacky z-index values when grouping layers
❌ Don’t
Apply isolate everywhere without a layering need
Assume isolation fixes all z-index bugs automatically
Hide important content behind negative z-index layers
Forget that DOM order still matters for accessibility
Replace thoughtful structure with excessive stacking tricks
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about isolation
Use these points when managing component layers and stacking contexts.
5
Core concepts
▦01
Stacking
Layer groups.
Purpose
auto02
Default auto
Browser pick.
Default
iso03
isolate
Force context.
Syntax
z:-104
Negative z
Contain layers.
Pattern
blend05
Blend modes
Local effects.
Use case
❓ Frequently Asked Questions
isolation controls whether an element creates a new stacking context. The isolate value forces a new stacking context so child layers stay grouped with the element.
The default is auto, which lets the browser create a stacking context only when other properties such as z-index, opacity, or transform require it.
auto follows normal stacking rules, while isolate always creates a new stacking context even if no other property would trigger one.
No. isolation is not inherited.
Use it when you need predictable layering inside a component, especially with negative z-index children or mix-blend-mode effects.