Using Opacity of a Div without affecting The color of the Paragraph inside the Div


I have created a div with background color black, and written a p inside it with white. When I am using opacity in the div, the color of the p is also getting changed into gray. Is there any way to change the opacity only of the div without affecting the color of the p?

6/30/2015 5:09:00 PM

Just read this article. It explains everything:

You should have:

div {
     background: rgba(0, 0, 0, 0.5);
     color: #fff; 

There are also same or similar questions here, like this:

5/23/2017 12:40:00 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow

Website under construction!!!