I have some absolutely positioned boxes. One of them has nested popup, larger then box. I want to make popup in front of all the boxes.
Setting z-index: 100
The core idea is that elements are rendered recursively in DOM tree-order (depth-first):
This means that tree-order of parents has a priority over z-index of their children.
In example in question all the foo boxes have equal zindex=100 and was tree-ordered at step 3. Some "uncles" of popup are rendered after parents.
References:
https://www.w3.org/TR/CSS22/visuren.html#propdef-z-index https://www.w3.org/TR/CSS22/zindex.html