CSS Stacking Context - Interactive CSS Lab | IconVault
Visualize CSS stacking contexts and z-index paint order live. Tweak position, opacity, transform and isolation, see what paints on top.
CSS Stacking Context
Interactive z-index and paint-order visualizer
Live stage (boxes overlap on purpose)
Paint order (back to front)
Spec order: negative z-index stacking contexts, then non-positioned blocks, then positioned z-index 0/auto (and z:auto stacking contexts in DOM order), then positive z-index. A parent that forms a stacking context traps its children inside it: no child z-index can ever escape above a sibling stacking context.
/* Paint order, back to front: A → B → C */
.box-a {
position: absolute;
z-index: 1;
}
.box-b {
position: absolute;
z-index: 2;
}
.box-c {
position: absolute;
z-index: 3;
}5 of 5 free uses left. All controls and the live stage are unlimited.
- position: absolute with z-index 1 (a positioned z-index always creates one)
- position: absolute with z-index 2 (a positioned z-index always creates one)
- position: absolute with z-index 3 (a positioned z-index always creates one)
About this tool
IconVault's CSS Stacking Context visualizer turns the most confusing part of CSS painting into something you can poke. Three overlapping boxes each get live controls for position, z-index, opacity, transform, isolation and filter. The stage renders your exact values while a back-to-front paint-order readout, computed per the spec, explains which box wins and why.
Gotcha alerts fire as you experiment: z-index ignored on static elements, opacity below 1 creating a stacking context, transforms and filters trapping children. It is free, runs fully in your browser, and the current setup exports as copyable CSS with the paint order baked into a comment.
Frequently asked questions
Popular searches
More tools
Algorithm Visualizer
Watch sorting and searching animate step by step
Alt Text Helper
Write better image alt text with live feedback
ARIA Reference
Searchable ARIA roles and attributes guide
Array Visualizer
Step through map, filter, reduce like a debugger
Coming soon
CLI
Coming soon
Figma plugin
Coming soon
VS Code extension
Coming soon
Chrome extension
Coming soon
AI icon generator
Coming soon
Team workspaces
Coming soon