I'm using z-index on my page ( -link no longer needed- ), and it doesn't work properly: it doesn't place certain divs above all others...
You can see it yourself, by clicking one of the items in the left, or right bar. Then, the mask will fade in, but show the message box, beneath it. I've tried a lot, but I just can't get the message box to show above all others...
What can I do to fix this? [note: 2nd question below!]
If you don't want to check the page, the message box is located in some other divs:
<div>
<div>
<div>message box</div>
</div>
</div>
The CSS positioning is like this:
.window {
position: fixed;
left: 0px;
top: 0px;
z-index: 100;
}
I use position:fixed, because position:absolute is not absolute here, the div is not aligned to the body, but something else somehow. Is there a way to reset the positioning and absolute position it again?
You set z-index on a static element By default, every element has a position of static. z-index only works on positioned elements (relative, absolute, fixed, sticky) so if you set a z-index on an element with a static position, it won't work.
The maximum range is ±2147483647. In CSS code bases, you'll often see z-index values of 999, 9999 or 99999.
z-index only works for positioned elements But z-index will only take affect if the element also has a position value of absolute , relative or fixed .
For as long as I can remember, z-index issues often come from the fact than the parents of the z-indexed elements are not positioned. Sibling parents should be positioned.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With