diagnostic · one of 50 24-hour trial, then Pro
Z-index
Why is my modal behind the header?
A z-index of 9999 loses to a z-index of 1 whenever the two are in different stacking contexts, and nothing in the browser tells you a context exists. This maps them: which elements create one, what is inside each, and where the element you care about actually sits.
Reach it Press ⌘ + K on any tab and type z-index. Ctrl + K on Windows and Linux
in the panel · 24-hour trial, then Pro
What this actually is
Whenever something is behind something it should be in front of and the z-index looks right. The answer is almost always an ancestor rather than the element itself, which is exactly what a tree shows and a single-element inspector does not.
What creates a stacking context
- position + z-index
- relative, absolute or fixed with any z value other than auto
- transform
- any value other than none - the usual cause of a sticky header breaking
- filter, backdrop-filter
- including a filter used only for a hover state
- isolation: isolate
- deliberate, and the cleanest fix when you need one
- will-change
- on transform, opacity or filter
- opacity < 1
- a fade animation creates and destroys a context as it runs
Asked about this diagnostic
Does it change the page?
No. It reads computed styles and draws an overlay. Nothing is written to the document, and the overlay disappears with the panel.
Why does my z-index of 9999 still lose?
Because it is competing inside a parent context, not against the element you think. The ladder shows the parent that boxed it in, which is usually a transform or a filter several levels up.
What counts as a trap?
A context whose children can never paint above its siblings, whatever z they declare. Those rows are marked so you fix the parent rather than raising the child again.
Does it work inside iframes?
Same-origin iframes are walked as part of the page. Cross-origin frames are listed but not entered - the browser does not allow it, and the Iframes diagnostic covers what is visible from outside.
Does it cost anything?
For the trial, yes: every tool in the panel is open for 24 hours after install, this one included, with no counter. After that the panel needs Pro, monthly or as one Lifetime payment.
how to use z-index
- Open Z-index on the page where something sits behind something else.
- Read which elements create a stacking context, and what is inside each one.
- Find your element in that tree. The answer is almost always an ancestor, not the element itself.
-
A
z-indexof 9999 loses to a 1 in a different context, so fix the ancestor.
written about at length
- layout 4 min Why your sticky header stops sticking position: sticky fails silently, and almost never because of the element it is set on. The ancestor properties that break it, and how to find the one that did.
- layout 6 min Why z-index: 9999 does not put your element on top A stacking context is a box a child cannot climb out of, whatever number you write inside it. How to find the ancestor actually deciding the order.
101 of these · no host permissions · 24 hours of all of them