Typefully

Stacking and z-index in CSS

Avatar

Share

 • 

4 years ago

 • 

View on X

A friendly reminder to don't change the z-index like gambling with the highest value, if it doesn't work as expected check the stacking context of the early elements in the hierarchy. `position` is just one of the attrs creating stacking contexts. e.g. check `isolation`. #webdev
developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context
developer.mozilla.org/en-US/docs/Web/CSS/isolation
This is basic stuff for a lot of developers but is often misused anyway. Yes, read this whole thing first or continue gambling. 😉 developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index
Avatar

Nils

@nilsandrey

🇨🇺 🇨🇦 Software developer, I like sports and movies. Family first. My friends are part of my world.