I want to let the background-image have an opacity: 1
(opaque) at the top red bar and opacity: 0.9
(transparent) at the rest part down below.
for now it is:
body {
font-family: sans-serif;
background-image: url("./LoveLive-SuperStar.png");
opacity: 0.9;
background-position: center;
background-attachment: fixed;
background-repeat: no-repeat;
margin: 0;
}
.head {
width: 100%;
height: 80px;
position: absolute;
top: 0;
left: 0;
background-color: #94070A;
text-align: center;
color: #FFFFFF;
}
MDN says opacity applies to the element as a whole, including its contents, even though the value is not inherited by child elements. Thus, the element and its children all have the same opacity relative to the element's background, even if they have different opacities relative to one another.