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

CSS样式表
最窄770px最宽1024px的经典布局研究
CSS使用心得体会
用CSS实现链接的虚线下划线效果
快速制作CSS导航菜单教
给图片在博客中添加滤镜效果
DIV+CSS网页制作布局技巧学习
CSS书写顺序
WEB标准字体常规定义
XHTML标准的版本
同一个页面用多个id有什么影响
初学web标准的几个误区
解决URL中含有-与号-不符合标准问题
用CSS实现表单form布局
CSS关于相对定位和绝对定位的说明实例
DIV+CSS不一定符合标准
CSS滤镜参考
怎样才能使大网站规范
利用CSS,链接下划线也玩自定义
CSS实现光滑圆角效果
最基本的几种CSS文字滤镜效果

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


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