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

CSS样式表
英文教程:五种CSS选择器类型
网页缓冲效果特效代码
CSS教程:CSS让网页文字自动隐藏
利用CSS在导航条上标示当前所在频道
CSS教程:网页无序列表标记的设计
.clear方法解决网页自适应高度的问题
CSS教程(7):网页段落行间距控制的实例
CSS教程(6):实例学习CSS如何控制网页文本
CSS教程(3):通过实例学习CSS背景
CSS教程(2):通过实例学习CSS背景
制作网页使用的CSS样式表错误排查方法
CSS Hack(Safari、Opera、Firefox3和IE7)
CSS教程:vlink,alink,link和a:link
CSS标示导航条当前所在频道
CSS制作网页时遇到BUG的解决方法
CSS教程:clip属性详细讲解
div层被flash层遮盖问题解决思路
CSS教程:CSS控制网页文字排版实例
Web标准建构的站点一览表
CSS实例:vertical-align属性让网页层居中

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


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