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

CSS样式表
IE和Firefox浏览器CSS网页布局不同点
CSS改变选择网页文字背景色
CSS3教程(1):什么是CSS3
浏览器Apple Safari和Google Chrome内核webkit
YaHoo方法:CSS Reset重设浏览器的样式
你知道吗?CSS样式表也能挂网页木马
通过宜家的家具设计方法学习CSS模块化
可读性CSS代码编写的小技巧
建议网页开发者使用IE8测试版测试网站
帮我写出更好的CSS代码的一些技巧
CSS初学福音:解决你对英文单词的不理解
两个CSS代码精简工具(网页推荐)
IE6图片元素img下出现多余空白的问题
将设计稿转换成WEB页面职业者
W3C标准以及XHTML和HTML
网页字体该如何设置?
学CSS网页布局排查错误的方法
CSS常见的让元素水平居中显示的方法
CSS网页布局教程:CSS伪类定义3种方法
CSS模块化思想的优势

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


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