I am struggling to create an overlay effect that is not displaying correctly.
.overlay {
position: absolute;
background-color: rgba(0, 0, 0, 0.6);
z-index: -1;
width: 100%;
height: 100%;
}
.center-div {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 9999;
}
<div class="center-div">
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
</p>
</div>
<div class="overlay">
</div>
The issue I am facing is getting the div with the center-div class to appear above the div with the overlay class.
Can anyone identify what's causing this problem?