I have previously written an article about CSS transparency, complaining that after CSS sets transparency for an element, the elements in it are also transparent. Recently I found that this is actually quite good.
Sometimes we want an opaque background text, such as an "Information warning box", but when we add the opacity attribute to this element, it was found that the background and everything in it were translucent, making it difficult to identify.
If you stick to opacity, you will find it difficult to use opacity to make the background translucent text opaque. So, like me, I think W3C's transparency settings really hurt.
In fact, we are wrong.
To make the background translucent text opaqueBackgroundSetRgbaForm! For example:
Background: rgba (0.5, 0 );
Instead, set the color to rgba if the text is translucent and the background does not matter!
If you need to maintain a transparency for all the child elements of this elementOpacityAttribute:
Opacity: 0.5;
We can think like this: if you want to keep a transparency for all elements in a region, but the opacity of CSS cannot inherit, how much will you feel! How many elements do you need To Set opacity?
Appendix 1:
So, I think the CSS transparency settings are quite good now, and I am in favor of it-but how can I hate ie again? Mom, does ie support the rgba color format!
Http://www.jo2.org/archives/291.htm.