DEV Community

Discussion on: Ways to write BAD CSS

Collapse
 
moopet profile image
Ben Sinclair

I think making z-indexes multiples of 10 or 100 is a sound idea, for the same reason it made sense in BASIC line numbering. Without a system to renumber them for you, if you want something to appear between two layers, you're in for a long morning.

Collapse
 
deyrupak profile image
Rupak Dey

Unfortunately, z-index is one of those properties that doesn’t always behave in an intuitive way. It seems simple at first; a higher z-index number means the element will be on top of elements with lower z-index numbers. But there are some additional rules that make things more complicated.

Anyway, all developers go by one rule : 'If it works, don't touch it!' πŸ˜‚

So, if multiples of 10 or 100 is working, you know what to do πŸ˜‚πŸ€£

Collapse
 
nikolab profile image
Nikola Betica

Was looking for this comment :)