The opacity declaration is used to set the transparency value of an element. (The transparency value is a decimal point between 0 and 1. 0.5 indicates 50% transparency ).
Opacity features that when opacity sets the transparency value of an element, the internal text and elements are also transparent.
. Demo {background-color: red; filter: alpha (opacity = 30); opacity: 0.3 ;}
Note: The transparent value of the label element whose class is demo is 30%, and the text transparency value in this code will also change to 30%.
Rgba is also used to set the color.
R: positive integer in red | percentage
G: positive integer in green | percentage
B: positive integer in Blue | percentage
A: transparency (value range: 0-1)
The color value set through rgba is only for the current element. The transparency value of the internal text and element has not changed.
. Demo {background-color: rgba (0.3, 0 )}
Rgba sets the color value for browser support: