You can use the background-color: rgba()
notation:
#theIdofYourElement,
.classOfElements {
background-color: #fff;
background-color: rgba(255,255,255,0.5);
}
Edited to add the default background-color
(for browsers that don’t understand the rgba()
notation). Albeit I was under the impression that all but IE do understand it (but I could be wrong, and haven’t tested to be sure…).
Edit with thanks to @akamike.
Edited to address question from OP (in comments):
which browsers don’t understand rgba? will they all in the future, is this part of css3?
The best information I could find is the CSS Tricks’ rgba()
browser support table, with a link to a demo and ‘more complete’ compatibility table.