I have 2 section header and main(red one). i set z-index to 100 and want to bring main section to front but it goes to back i want to know what cause this in css?
#red {
margin-top: -10px;
background-color: red;
height: 100px;
z-index: 100;
}
.img-fluid {
max-width: 100%;
height: auto;
}
<header style="background-color: black;">
<img class="img-fluid" src="https://via.placeholder.com/1000x100" />
</header>
<main id="red" role="main">
<div class="container">
Red
</div>
</main>