7 ms·
You still have the issue of the z-index being relative to its parent, and not absolute. So depending on which element it is set, its effect would not be the sam
by louhike 4y ago
You still have the issue of the z-index being relative to its parent, and not absolute. So depending on which element it is set, its effect would not be the same. It’s still a good practice to use constants, but I still often had difficulties to place elements relative to each others on the z-index.
- eurasiantiger 4y agoJust use position: relative to start a new stacking context as appropriate.
- louhike 4y agoI know, but it’s still hard to use on a big website where you have to manage a lot of stacking contexts.
- JimDabell 4y agoYou can use isolation: isolate to explicitly create a new stacking context now. It makes the code a bit clearer because position: relative is used for lots of different things.