- Opacity: 0.5; this is the most important because it is the CSS standard. This attribute supports Firefox,
Safari and opera.
- Filter: alpha (opacity = 50); this is set for IE6, the value can be 0-100, and the other three 0 to 1.
- -Moz-opacity: 0.5; To support earlier Mozilla browsers.
- -Khtml-opacity: 0.5; to support some older versions of Safari browsers.
However, the transparency attribute of CSS involves an inheritance problem. When transparency is set for the parent element, the child element automatically inherits its transparency.
TIPS:
1. If the sub-element is text, it is usually clear if it can be viewed.
Another compromise is to specify a relatively deeper color for the text book element. That is to say, when the child element inherits transparency, the text color is exactly what you want.
2. For layers, you can use absolute positioning.
3. Used for button hover effect, which is a lazy practice.