Why does position:relative; appear to change the z-index?
You need to refer to the specification and more precisely the painting order to understand when each layer is painted. Without position:relative your element is not positioned and will be painted at the step (4): For all its in-flow, non-positioned, block-level descendants in tree order: If the element is a block, list-item, or other block … Read more