当前位置: 首页 > 图文教程 > 网页制作 > CSS样式表 > css 透明度的设置兼容所有浏览器

CSS样式表
脚本控制三行三列自适应高度DIV布局
通过CSS Hack 区分 FF/IE7/IE6/IE5.5/IE5 代码推荐
HTML/XHTML模板
用DIV+CSS写小三角
SPAN元素和DIV元素有的区别
关于Firefox中的Flash不可以显示透明效果的问题
当ie7不认!important之后 [布局的解决办法]
绝对定位的DIV宽度自动适应的一个方法
被人遗忘的html tags
一个css 的小问题
IE 5.x/Win 和模型bug
[转]目前找到的最好的Iframe自适应高度代码
Web Safe Color Pallette
网站制作之网页技巧
http状态码一览表
从Table向Css过渡的优缺点比较
不用float实现div模块居中布局
解决列高度自适应(相同)的五种方法
用CSS floats创建三栏页布局
如何正确使用标题元素、段落和强制换行

CSS样式表 中的 css 透明度的设置兼容所有浏览器


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-11   浏览: 121 ::
收藏到网摘: n/a


代码如下:

.transparent_class {filter:alpha(opacity=50);-moz-opacity:0.5;-khtml-opacity: 0.5; opacity: 0.5;}

UPDATE: I wanted to pull this post out of the archives and update it a bit because it there seems to be a good amount of interest in this subject.

Here is what each of those CSS properties is for:

       
  • opacity: 0.5; This is the “most important” one because it is the current standard in CSS. This will work in most versions of Firefox, Safari, and Opera. This would be all you need if all browsers supported current standards. Which, of course, they don’t.
  •    
  • filter:alpha(opacity=50); This one you need for IE.
  •    
  • -moz-opacity:0.5; You need this one to support way old school versions of the Mozilla browsers like Netscape Navigator.
  •    
  • -khtml-opacity: 0.5; This is for way old versions of Safari (1.x) when the rendering engine it was using was still referred to as KTHML, as opposed to the current WebKit.

来源:http://css-tricks.com/css-transparency-settings-for-all-broswers/
 这个我就不想翻译了,很简单,我也只是为了做个记录。哈~~~