Tailwind CSS
/Beginner
z-index
Definition
Utilities for controlling the stack order (depth) of positioned elements.
Explain Like I'm New
The 3D depth of your website. If a Modal pops up, it needs to be 'closer' to the user's face than the background. Higher numbers are closer. `z-50` will cover `z-10`.
Real World Example
Ensuring a dropdown menu (`z-10`) drops down OVER the text below it, rather than slipping underneath the text.
Common Use Cases
- •Modals
- •Dropdowns
- •Sticky Headers
- •Tooltips
Interactive Example
Interview Questions
basic
- What is the highest default `z-index` class provided by Tailwind?
intermediate
- If Element A is `z-50`, but its parent is `z-0`, can Element A cover Element B which is `z-10`?