written by Shannon Lynd on Friday, April 26, 2013
For some reason, I just couldn't figure out how to make the background of a div transparent without also making the text transparent as well. Here's the answer.
The HTML
<div class="bg">This is the non-transparent text.</div>
The CSS
.bg {
background-color:rgba(0,0,0,0.5);
padding:20px;
margin:200px auto;
width:300px;
color:fff;
}