I have been searching around on how to add a black overlay like an example: https://ocean19.com/wp-content/uploads/2017/04/black.jpg
but only using html and css. I have tried many ways but i still failed. Is it possible to only use html and css or should i also use javascript and other things?
My current code :
html:
<div class="container">
<img src="image/head1.jpg" class="center-fit">
<div class="centered">Centered</div>
</div>
css:
.container {
position: relative;
text-align: center;
color: white;
height:100%;
display: grid;
}
.center-fit {
width: 100%;
max-width: 1903px;
max-height: auto;
position: absolute;
margin-left: -8px;
background: rgba(0, 0, 0,1);
}