<div class="content">
This is the content you want to mask.
<div class="mask"></div>
</div>
.content {
position: relative;
z-index: 1;
}
.mask {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: black;
opacity: 0.5;
z-index: 2;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.