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's
Higher z-index
means higher position in the z-axis. Here, AP1 is above AP2, because it has higher z-index
value.
If they had the same value, then the order of their positioned parents is obeyed, and AP1 would be below AP2.
RP1: This is relatively positioned block
AP1: This is absolutely positioned block, with z-index:20
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, with z-index:10
Content after the second RP block... Content after the second RP block... Content after the second RP block... Content after the second RP block...
If I move RP1 so that it overlaps with RP2, we get clearer picture of spec violation. RP1 is below RP2 (which is OK), but AP1 is above AP2 which is wrong.
RP1: This is relatively positioned block
AP1: This is absolutely positioned block, with z-index:20
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, with z-index:10
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