I mean I have <section>
tag and I have background-image: url(...)
and I want to know how to change the opacity of background but without changing opacity of child tags.
This is my code:
section {
background-size: cover;
margin: 0px;
background: red;
padding: 10px 10px 10px 10px;
background-repeat: no-repeat;
background-position: center;
}
#study {
background-image: url(2.jpg);
}
h1,h2 {
font-weight: 1000;
font-size: 60px;
text-align:center;
color: black;
letter-spacing: 5px;
z-index: 500;
user-select:none;
}
#study:hover {
opacity: 0.8
}
<section id=study>
<h2>Text</h2>
<h2>But text gets lighter too!</h2>
</section>