Using CSS3 's transparent properties opacity can animate the fade fade of objects, but in many cases this single fade fade effect does not meet our daily development needs. Sometimes we need to add a subset object to the object that sets the Opacity property to meet our requirements. But CSS3 's opacity (eg: opacity:0.5;) The transparency property is inherited, and its subset elements have a transparency effect when the opacity transparency property is set on an object.
The background color of RGBA can be used to set the transparency effect of an object very directly, and there is no inheritance for its subset elements, whereas an object that uses the RGB color and sets the opacity transparency property produces transparency inheritance.
一般不想要继承的情况下用rgba 的效果很好 background:rgba(0,0,0,.5) ;
How to solve the inheritance problem of opacity transparency property in CSS3