I have two empty div elements inside a div. The two elements are class labeled as "img" and "overlay". On the "img" I attached a background url and the "overlay" I only want to add a background color on top of the background url adding an overlay effect.
I tried playing with positions, height and padding but it only misalign the items. The divs are inside another div which has a grid display property.
Html Part:
<section id="grid">
<div class="main">
<div class="img"></div>
<div class="overlay"></div>
</div>
</section>
Css Part:
.img{
height: 100%;
width: 100%;
background: url("../img/star.jpg");
background-size: cover;
}
.overlay{
background-color: green;
}