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

CSS样式表
网页设计关于WEB标准的相关问题汇总
项目管理:交互-设计-制作三个角色的组合
学习CSS制作网页总结的一些经验
多个CSS样式表争夺特定选择符的控制权
网页设计制作CSS实现隔行换色两种方法
CSS教程:DIV底部放置文字
CSS教程:CSS命名参考
CSS教程:控制网页文件大小通过精简CSS实现
CSS教程:关于文字溢出问题的研究
符合web标准的嵌入Flash的方法
学习WEB标准必备的四项技能
CSS对表格单元格强制换行和不换行
CSS制作符合网站标准的细线表格
区分IE6,IE7和firefox的CSS hack
CSS教程:学习CSS的继承性
CSS教程:CSS兼容的技巧
CSS教程:浮动元素对浏览器的支持
闭合浮动元素让CSS代码更规范
深入分析网页CSS隐藏文字和以图换字技术
看懂《CSS hack浏览器兼容一览表》

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-11   浏览: 66 ::
收藏到网摘: 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/
 这个我就不想翻译了,很简单,我也只是为了做个记录。哈~~~