concept
stacking-context-atomicity — CSS reference
A nested stacking context is treated as a single group in its parent context. Descendants may be ordered within the group, but even a very large child z-index cannot outrank a sibling context above its parent.
Formal Syntax & Structure
css syntaxcss
position: relative; z-index: 1; /* example trigger */Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS positioning lab</title><style>body {margin:0} .sample {background:#dcebe9;color:#182e32}#p{width:240px;height:160px;background:#e6eef2} #a{width:60px;height:30px;background:#128579} #b{height:20px;background:#adcde8}#p{position:relative}#a,#b,#c{position:absolute;left:20px;top:20px;width:100px;height:70px}#a{z-index:1}#b{z-index:2}#c{z-index:999;left:0;top:0;background:orange}</style><body><div id="p"><div id="a"><div id="c">Child 999</div></div><div id="b">Sibling 2</div></div></body></html>