I am attempting to design a div element with a basic background color and some text displayed on it. I would like to lower the opacity of the background color in this div, but every time I try, the opacity of the text also changes. Is there a way to adjust the opacity of the background color only without affecting the text?
.main{
background-color: red;
width: 100%;
height: 200px;
opacity: 0.5;
}
<div class="main">
<p>The opacity of this text should remain unchanged.</p>
</div>