I am facing a challenge where I want to insert content into a contentbar that has an opacity of 0.6. However, I do not want the content (such as text or videos) to have the same opacity as the contentbar. I attempted to place them in separate div tags with one nested inside the other, but this caused the text to not appear on top of the contentbar.
I hope my explanation was clear enough.
.content {
color: #ffffff;
position: relative;
z-index:1;
}
.bg {
width: 80%
opacity: .6;
background-color: #000000;
margin-left: 10%;
margin-right: 10%;
border-radius: 3px;
overflow: hidden;
}
<div class="content">
<p>Hello World!</p>
<div class="bg">
<h1>Hello world!</h1>
</div>
</div>