CSS background opacity

· Ben’s Blog


How to adjust the opacity of the background of a div without affecting child elements:

1.alpha60 {
2  /* Fallback for web browsers that doesn't support RGBa */
3  background: rgb(0, 0, 0);
4  /* RGBa with 0.6 opacity */
5  background: rgba(0, 0, 0, 0.6);
6}