Consider this basic HTML structure:
div {
box-sizing: border-box;
color: white;
font-size: 28px;
height: 100px;
width: 200px;
}
#a { background: blue; padding-top: 40px; }
#b { background: green; margin-top: -100px; }
<div id="a">a</div>
<div id="b">b</div>
In this scenario, element b completely covers element a, yet the letter "a" is still visible. Why is that happening?
I have reviewed the stacking order rules at https://www.w3.org/TR/CSS2/zindex.html but couldn't find an explanation.
Could the text node be positioned differently? What am I overlooking?
Check out the Codepen demo I made here: https://codepen.io/anon/pen/KEaqaQ