DEV Community

Discussion on: A Better Way to Manage Z-Indexes

Collapse
 
chuniversiteit profile image
Chun Fei Lung

The first few examples remind me of programming in BASIC, where one could run into similar issues with its line numbers. 😅

On a more serious note, wouldn’t different stacking contexts make z-indexes even more manageable?

Collapse
 
massic80 profile image
Massimiliano Caniparoli

Yes, stacking context is the key.
I usually find problems when trying to set something above the rest, but "the rest" is laying on another, higher stacking context.
Giving whatever z-index to my object wouldn't solve: I need to change an ancestor.