isolation
Widely availableSince 202097% of users
Defines whether an element must create a new stacking context. This is useful for preventing mix-blend-mode or z-index from affecting elements outside of a specific container.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyModernIn every major browser since January 2020. Widely available since July 2022.
The old way and the modern waySee the snippet: Prevent z-index from escaping containers →
Old way 12 lines
/* Before isolation: force a stacking context with position + z-index */
.card-container {
position: relative;
z-index: 1;
/* Works, but z-index: 1 also joins the global ordering */
}
.card {
position: relative;
z-index: 100;
}
/* Or: restructure HTML to move overlapping content */
/* Or: manage z-index globally across entire page (brittle, scales poorly) */Modern 8 lines
.card-container {
isolation: isolate;
}
.card {
position: relative;
z-index: 100;
}
/* z-index contained within .card-container */See how modern your own CSS is.Check your CSS →
Quick facts
- Initial value
auto- Inherited
- No
- Applies to
- all elements, SVG container, graphics, and graphics-referencing elements
- Animation type
- notAnimatable
Quick example
.widget-container {
isolation: isolate;
/* prevents children with blend modes from bleeding into the page background */
}Values
autoisolateisolation browser support
BaselineWidely availableThis feature is well established and works across many devices and browser versions. It has been available across browsers since 2020.Safe to use without fallbacks.
Usage97%of people can use this3% use a browser without it.
Browsers
41+
36+
8+
79+Mobile
41+Android
36+Android
8+iOS