CSS settings element Transparency code example:
This section describes how to set the transparency of an element, which is now used for many effects, and describes how to achieve this effect.
The opacity provides a standard set of properties for transparency, which is between 0-1, 0 is completely transparent, and 1 is completely opaque.
The code is as follows:
<!DOCTYPE HTML><HTML><Head><MetaCharSet= "Utf-8"><Metaname= "Author"content= "http://www.softwhy.com/" /><title>Ant Tribe</title><styletype= "Text/css">Div{width:100px;Height:100px;background:Red;Opacity:0.3;}</style></Head><Body><Div></Div></Body></HTML>
The above code works perfectly in Google and Mozilla Firefox, but not in the IE8 and IE8 browsers because they do not support opacity properties.
The code is modified as follows:
<!DOCTYPE HTML><HTML><Head><MetaCharSet= "Utf-8"><Metaname= "Author"content= "http://www.softwhy.com/" /><title>Ant Tribe</title><styletype= "Text/css">Div{width:100px;Height:100px;background:Red;Opacity:0.3;Filter:Alpha (opacity=30);}</style></Head><Body><Div></Div></Body></HTML>
The above code implements our requirements, that is, add Filter:alpha (opacity=30), this IE browser support, it is important to note that the opacity value in parentheses is 0-100, 0 is completely transparent, 100 is completely opaque.
The original address is: http://www.softwhy.com/forum.php?mod=viewthread&tid=12918
For more information, refer to: http://www.softwhy.com/divcss/
CSS setting element Transparency code Instance