Set the opacity or RGBA color, opacityrgba color
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 transparent value of the text and element in the Code is also 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(255,0,0,0.3)}
Note: the transparency value of the label element in this Code class is 30%, and the text and element transparency values in the demo do not change.
RGBA sets the color value for browser support:
Css opacity inheritance issues, how do I not integrate parent-level background color transparency?
The opacity attribute is valid only for the elements of the application attribute. child elements (including child elements) are not inherited and the values are between 0 and 1 (0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1), 0 is completely transparent, and 1 is completely opaque. Opacity will make all the elements transparent, not just the background color. If you only need to make the background transparent, you can use rgba ():
Background: raba (x1, x2, x3, y );
The value of x1 x2 x3 is an integer between 0 and 25 5.
The value y is between 0 and 1 (0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1)
IE, you can use a filter, filter: alpha ()
Use the following code to test non-ie browsers:
The opacity.html file code is as follows:
<! Doctype html>
How to set the color of css to rgba?
What tools !?
Ediplus, UE, dreamwave .....