z-index & Stacking Context Playground

Mr. Karim’s flyer and Mrs. Yanti’s stamp overlap on the market board: write their declarations, elementFromPoint answers who is on top, and every stacking…

Why it matters

"z-index is already 9999 but the modal/tooltip is still covered" is one of the most frustrating CSS bugs. Once you understand stacking contexts, you know to look for the parent that starts a context, not to keep raising the number.

The key idea

z-index is only compared inside one stacking context

Common mistakes

Try it in this playground