My content below my header positions itself above the header which I gave a higher z-index
.
As a consequence, it hides the shadow on the header.
Even stranger behavior is when I add a negative margin on the content below: You can see the header text but now has a background color from the content.
header {
z-index: 999999;
background-color: green;
width: 100%;
text-align: center;
box-shadow: 0 0ex 2ex hsl(0, 0%, 0%);
vertical-align: middle;
}
div {
background: red;
height: 8em;
/* margin-top: -5em; */
}
<body>
<header>Some text<br><br>Some more text</header>
<div>My div</div>
</body>
I tried putting a negative z-index
on my content and that solves the problem, but then all elements in my content become inactive.
(E.g., I can't click or hover anything any more.)