6
One thing I’ve always found in CSS to be the most disorganized thing is the use of z-index
.
Often some frameworks/libraries, or even some developers, place an exaggerated value on z-index
, causing problems with their organization.
I always wondered, for example, if there was a way to catch the z-index
maximum used throughout the document (I imagine that if possible, only by Javascript). For example, if the element a
uses z-index
2 and the b
uses 3
, there would be some way to capture the 3
and its element?
Another thing: Is there any alternative, pattern or organization to avoid confusion regarding the use of z-index
? Currently, I practically have to remember where, in each part of the project, I defined the attributes z-index
and increasing "mentally".
Is there any easier way to organize the use of a z-index
in a large project to avoid overlapping disorders? Is there any other attribute?
Observing: I even remember asking you something like, but this time the doubt is another.
z-index can be relative to the element. A z-index 999 can be placed behind a z-index -1 of an element that is already above the 999 Parent
– Bacco