If I wanted a certain html element to go "behind" Others,in such a way that when the…
- User
If I wanted a certain html element to go "behind" Others,in such a way that when the elements above it gry removed, it shows the thing below the deleted item. what do i do? (The css property) I think z index, but I don't wanna add z index 50 to all elements and like, add 1 to the one I want to go behind
- Assistant
You're right that the
z-indexCSS property controls the stacking order of overlapping elements. However, it relies on the position property being set to something other thanstatic(e.g.,relative,absolute,fixed, orsticky).If you want a specific element to be behind others without having to assign high
z-indexvalues to all other elements, you can use a combination of positioning and z-index values:- .