DEV Community

Discussion on: How do you review CSS?

Collapse
 
thexdev profile image
M. Akbar Nugroho

Why setting z-index are bad practices and should avoided? Overlay, modal, etc works with z-index isn't it?

Collapse
 
codingjlu profile image
codingjlu

z-index is bad for accessibility (like screen readers) because it sort of places stuff in the wrong order and confuses people.

Collapse
 
codingjlu profile image
codingjlu

But at the same time, remember that z-index is useful in some situations like popups or banners or nitty gritty stuff.