z-index
value to RP and AP blocksz-index:1
to AP1z-index
to both AP blocksz-index:11
to RP1z-index:21
to RP1z-index
to RP2 than to RP1, but identical z-index
to AP1 and AP2z-index
where RP2 > RP1, and AP2 < AP1, both being higher then any RP'sWe have two RP blocks, and one AP block + one non-positioned paragraph in each of them. No z-index
is applied.
CSS2.1 spec says that each positioned element defines stacking context for all its children. Further, if any of the child elements is positioned, it defines new, internal stacking context. Nothing that is outside the stacking context can come between elements inside of the stacking context.
Translated in english and applied to the situation I have here, it means that:
You can imagine stacking contexts are solid boxes. No matter what you have or do inside of that box, its elements are constrained by those boxes and can not mix. The whole RP1 box can either be totally above or totally below RP2. It can't happen that one part of RP1 is below RP2 and other part is above RP2.
RP1: This is relatively positioned block
AP1: This is absolutely positioned block
Content between the RP blocks... Content between the RP blocks... Content between the RP blocks... Content between the RP blocks...
RP2: This is relatively positioned block
AP2: This is absolutely positioned block
Content after the second RP block... Content after the second RP block... Content after the second RP block... Content after the second RP block...
RP = relatively positioned element
AP = absolutely positioned element