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

CSS样式表
全面了解CSS
单纯使用CSS实现动态提示信息
像table一样布局div
一个自动居中的导航条实例与相关问题 DIV+CSS
一个导航条布局的简单写法
Overflow OPREA
空格BUG
DIV+CSS 网页TIP的简单作法
如何设置一个指定高度的DIV
CSS实现阴影文字效果
全面考察“禁用浏览器后退”
仿windows工具条样式
DOM属性用法速查手册
如何设置网页的背景为透明
凸起的按钮效果
带白边的黑字 css
什么是Unicode,什么是UTF-8
怎么让表格为固定大小,超出的部分显示为省略号
实用的标签效果
找到html标记对应的脚本属性

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


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