Mywebdunia's Blog

Posts Tagged ‘css transparency

If you looking for the transparent background for your drop down menu, either it might be for vertical menu or for horizontal menu. This is how you can get it done

#menu{
background-color:green;
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50); // for IE
opacity:0.5; // rest all browsers
}

If you want to set transparency for images or text, it could be done easily using CSS class attribute. Below example sets 50% transparency.

Example:
.transparentClass{
filter:alpha(opacity=50); // for IE5-7
-moz-opacity:0.5; // Netscape Navigator.
opacity:0.5; // for all other browsers
-ms-filter:”progid:DXImageTransform.Microsoft.Alpha(Opacity=50)”; // for IE5-8
}
The following code can be used to set transparency. the four
seperate CSS Statements are used for different browsers.


Categories