Reputation: 24911
How can the h2
element in this sandbox be brought up above the overlay?
<h1>Hello Plunker!</h1>
<h2>Above the overlay</h2>
<div class="overlay"></div>
.overlay {
position:absolute;
top:0;
bottom:0;
right:0;
left:0;
background-color: rgba(34, 34, 34, 0.8);
z-index:100;
}
h2 {
z-index:200;
}
https://plnkr.co/edit/md2lIJCbhnEcc1XAbrne?p=preview
Upvotes: 0
Views: 148
Reputation: 67748
If you mean that the h2
should be in front of the overlay DIV, change its CSS to:
h2 {
z-index: 200;
position: absolute;
color: white;
}
(I added the white color to make it clearer that it's not behind overlay
)
Upvotes: 0