Josh W Comeau avatar Josh W Comeau

What the heck, z-index??

Screenshot of “What the heck, z-index??”

I learned a lot with this detailed article about z-index!

When it comes to CSS, things work in a similar way: elements are grouped into stacking contexts. When we give an element a z-index, that value is only compared against other elements in the same context. z-index values are not global.