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

CSS样式表
CSS:提高网页在浏览器的渲染速度
css网页制作实用技巧9则
思考Web站点设计对类以及id的命名方式
CSS教程:关于网页图片的属性
CSS教程:元素层叠级别及z-index
div css在思路和流程上实现结构与表现的分离
CSS入门教程:网页首字下沉
IE6、IE7和FF的最简单的hack技巧
跨浏览器实现float:center
css技巧:经典CSS使用技巧几则
CSS教程:legend标签设定宽度
网站进行W3C XHTML1.0验证的经验
CSS教程:网页颜色的几种表示
网页CSS背景图片使用的测试结果
CSS网页布局:网页页面结构化
SPAN和DIV,Class与ID的区别汇总
xhtml css网页制作中问题解决的方式
div css与xhtml css是什么意思?
CSS样式表优化更整洁而简短
CSS设计网站导航菜单的优势

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


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