开发者

How can I controle the visibility level of a div and make it see through?

开发者 https://www.devze.com 2022-12-18 14:34 出处:网络
Can I control the visibility of some div in my website and make to become see-through using CSS only? In flash it\'s done through controlling what is ca开发者_Go百科lled Alfa so I\'m wondering if such

Can I control the visibility of some div in my website and make to become see-through using CSS only? In flash it's done through controlling what is ca开发者_Go百科lled Alfa so I'm wondering if such a thing exist in CSS!

Edition 001

Can I control the opacity of the div's background only? So the text in the div wouldn't be effected?


You can use opacity in CSS

.transparent_class {
 opacity: 0.5;
}

I think there are some problems with opacity in Internet Explorer so here is example how to change transparency in IE:

.opaque1 { // for all other browsers
 opacity: .5;
}

.opaque2 { // for IE5-7
 filter: alpha(opacity=50);
}

.opaque3 { // for IE8
 -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
}

HTH


http://www.quirksmode.org/css/opacity.html

.opaque1 {  // for all other browsers
    opacity: .5;
}

.opaque2 {  // for IE5-7
    filter: alpha(opacity=50);
}

.opaque3 {  // for IE8
    -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
}


Another way to make only the background transparent is by using a transparent png as background-image, and then use this jQuery fix for the special snowflake IE. This works in all browsers as far as I know.


Here is a good link talking about CSS navigation menue I hope it would be helpful:

http://www.webcredible.co.uk/user-friendly-resources/css/css-navigation-menu.shtml

0

精彩评论

暂无评论...
验证码 换一张
取 消