From where does the stacking count start in HTML? for the <html>
and <body>
tags.
I have seen many people writing zIndex: -99
to bring the item to the back.
But if z-index: -99
is possible, then what is the static z-index of the <html>
and <body>
elements?
Since the only reason we can't set the z-index on the <html>
and <body>
elements is that they're static.
CodePudding user response:
You aren't exactly using the terminology that the spec uses however I guess you could say they have z-index: 0
because if you set any child to z-index: 0
it has the default stacking order, if you put a positive z-index then it will go above, and if you put a negative then it will be below.