<div class="box">
<div class="mask"></div>
</div>
.box{
width: 400px;
height: 250px;
background: linear-gradient(to bottom, red, yellow);
position: relative;
}
.mask{
position: absolute;
background: rgba(0,0,0,.6);
inset-inline: 10px;
inset-block: 20px;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.