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

CSS样式表
web标准常见问题集合4
web标准常见问题集合5
我的一些关于web标准的思考笔记(一)
关于filter滤镜应用于图片的两种创意
Div+Css(+Js)菜单代码及制作工具
css写菜单:简洁注释版
标准布局应用:显示/隐藏侧边栏 [附详细注解]
小心:CSS代码书写顺序不同,导致显示效果不一样
解决鼠标在 flash 链接上不停闪动的问题(web页面中)
从gb到utf-8
html在线编辑器的更新[2006-05]
对hao123进行重构
韩国商业网站设计分析
模仿combox(select)控件,不用为美化select烦恼了。
【已解决】标签页刷新问题
以前写的两个CSS树形菜单
CSS样式表的背景渲染效率
第1天:选择什么样的DOCTYPE
第2天:什么是名字空间
第3天:定义语言编码

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


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