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

CSS样式表
CSS教程:dl dt dd模拟表格实例
网页制作实例:将PSD网站模板转换为XHTML+CSS网页
CSS布局实例代码:两列布局实例
border:none;与border:0;的区别
CSS浮动定位:引起文本重影的怪异问题
同一张PNG8图片为何部份图标在IE6中消失
IE6中背景属性加a与a:hover问题
网页制作教程:在IE7中的网页文本重影问题
推动浏览器更新的原因和方法
CSS实例教程:制作网页列表菜单
CSS实例教程:制作网站横向导航
CSS实例教程:制作网页2级导航
CSS研究教程:类名的长命名和短命名
CSS教程:彻底弄清楚CSS的行高属性
用CSS的float和clear属性进行三栏网页布局
没有JS只用CSS制作的网页下拉菜单
初学CSS的基础教程:在网页中使用CSS
网页制作教程:制作拖拽翻页
制作网页时编写CSS代码的25个小技巧
CSS3中很有用的特性:CSS阴影

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


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