Skip to content
Discussion options

You must be logged in to vote

z-index only applies to positioned elements — it does nothing on a position: static element (the default). Give it position: relative/absolute/fixed/sticky (or make it a flex/grid item, which also participate in z-index). Also watch for a parent that creates a new stacking context (transform, opacity < 1, filter), which traps the child's z-index inside that context.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Kevinchamplin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant