I am trying to put an image to the entire screen with full autoscale and full width and height of the screen, also ensuring that there is some opacity value of 0.6 so that the text that I try to put on top of the image should be dark and visible.
THIS IS THE CODE:
<body>
<div class=bodycontainer> <h2>This text </h2> </div>
</body>
CSS Code:
div.bodycontainer {
background-image:url('../images/mainbackground.jpg');
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
opacity:0.1;
}
But the image does not fit to the entire screen and also the opacity results in the opacity being applied to the text also.