I am trying to create a square with a background image and text on it while adjusting the opacity of the background image only.
However, I encountered an issue where setting the opacity value affects both the background image and the text. I attempted to separate the elements within the square into two sections and also experimented with changing the opacity of the background image separately before resetting the text's opacity to 1, but those solutions did not resolve the problem.
My Attempt:
<section>
<p>TEST</p>
</section>
CSS:
section {
height: 200px;
width: 300px;
background-image: url(Graphic/background.jpg);
opacity: 0.5;
}
section p {
color: white;
opacity: 1;
}