CSS3 provides us the opacity property. opacity sets the opaqueness of the element on which it’s declared. Similar to alpha transparency, the opacity value is a floating point number between (and including) 0 and 1. An opacity value of 0 defines the element as fully transparent, whereas an opacity value of 1 means the element is fully opaque.
example:
snippet
div.semiopaque {
background-color: rgb(0, 0, 0);
opacity: 0.5;
color: #000000;
}
div.semiopaque {
background-color: rgba(0, 0, 0, 0.5);
color: #000000;
}
The opacity sets the opacity value for an element and all of its children. Any text in the
semiopaque div will also be 50% opaque.
A semitransparent RGBA or HSLA color has no impact on elements other than the one it’s declared on.