Let's examine the html and css code below:
<div class="page">
<div class="region">
<div class="zone">
Left
</div>
<div class="zone">
Center
</div>
<div class="zone">
Right
</div>
</div>
<div class="region">
<div class="zone">
Left
</div>
<div class="zone">
Right
<div id="overlay"></div> <!--- Overlay -->
</div>
</div>
<div class="region">
<div class="zone">
Left
</div>
<div class="zone">
Center
</div>
<div class="zone">
Right
</div>
</div>
</div>
.page {
background-color: #333;
height: 100vh;
display: flex;
flex-direction: column;
flex-wrap: nowrap;
gap: 10px;
}
.region {
width: 100%;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
padding: 10px 0px;
position: relative;
z-index: 0;
gap: 20px;
&:first-of-type {
padding-top: 0px;
height: 130px;
}
&:nth-of-type(2) {
height: calc(100vh - 245px);
}
&:last-of-type {
padding-bottom: 0px;
}
}
.zone {
display: flex;
flex-direction: column;
flex: 1;
flex-wrap: nowrap;
justify-content: flex-start;
gap: 10px;
padding: 0px 10px;
background-color: #0000ff33;
&:first-of-type {
padding-left: 20px;
}
&:last-of-type {
padding-right: 20px;
}
}
#overlay {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1000;
background: #ffffff66;
}
Link to a live example: https://codepen.io/a11smiles/pen/rNQoaPv
An issue is identified where the overlay obscures the content of the top and middle flex-boxes, but not the footer. Despite setting the footer's z-index explicitly to 0, the overlay remains behind it. What could be causing this behavior?
Your insights are appreciated.