一句话搞定透明背景!
.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 .
相关推荐
[code] .transparent_class {filter:alpha(opacity=50);-moz-opacity:0.5;-khtml-opacity: 0.5; opacity: 0.5;} [/code] UPDATE: I wanted to pull this post out of the archives and update it a bit because it ...
纯css实现兼容各浏览器的颜色线性渐变,对角渐变,渐变角度设置,线性渐变透明度,及渐变方向、隔行变色等,支持设置结点渐变的效果。
要是两年前,实现“兼容性的渐变效果”这个说法估计不会被提出来的,那个时候,说起渐变背景,想到的多半是IE的渐变滤镜,其他浏览器尚未支持,但是,在对CSS3支持日趋完善的今天,实现兼容性的渐变背景效果已经完全...
用来设定元素透明度的 Opacity 是CSS 3里的一个属性。当然现在还只有少部分浏览器支持。不过各个浏览器都有自己的私有属性来支持,其中包括老版本的Mozilla和Safari: IE: filter:alpha(opacity) Mozilla: -moz-...
兼容各浏览器上下左右的渐变效果,渐变起始颜色,ff为16进制透明度
“opacity”声明用来设置一个元素的透明度:层、文字、图片等…一个opacity的值为1的元素是完全不透明的,反之,值为0是完全透明的,看不见的。1到0之间的任何值都表示该元素的透明程度。 浏览器兼容性 opacity是...
本文以大量实例形式总结了css与javascript跨浏览器的兼容性问题。分享给大家供大家参考。具体总结如下: 一、CSS样式兼容性 1. FLOAT闭合(clearing float) 网页在某些浏览器上显示错位很多时候都是因为使用了float...
透明往往能产生不错的网页视觉效果下面是兼容主流浏览器的CSS透明代码。 CSS Code复制内容到剪贴板 transparent_class { filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity: 0.5; ...
CSS3的透明度属性opacity想必大家都已经用...而对于不支持CSS3的浏览器如何进行透明处理,保持浏览器效果的一致,本篇文章主要介绍了详解CSS透明opacity和IE各版本透明度滤镜filter的最准确用法,有兴趣的可以了解一下。
opacity(不透明度) box-sizing(控制盒模型的组成模式):指定两个boxes接壤 resize(元素缩放):指定一个div元素,允许用户调整大小 outline(外边框) background-origin(指定背景图片从哪里开始显示) background-...
3. CSS透明 3 4. css中的width和padding 3 5. FF和IE BOX模型解释不一致导致相差2px 3 6. IE5 和IE6的BOX解释不一致 3 7. ul和ol列表缩进问题 3 8. 元素水平居中问题 3 9. Div的垂直居中问题 3 10. margin...
div+css布局的相关知识,包括浏览器兼容性问题、导航栏固定、透明度设置等等
CSS样式设置元素的透明度的方法有很多,不过兼容各种浏览器就屈指可数了,下面以将透明度设置为50%举例,向大家介绍下,感兴趣的朋友不要错过
在页面点击”注册”,出现一...主要由CSS控制,注册框的宽度和高度都已经确定( 620*420px ),首先使用position:fixed来使它相对于浏览器窗口绝对定位;然后使它垂直居中:top:50%; left:50%; margin:-210px 0 0 -310px
为了兼容IE与其他浏览器对透明度的设置,我们需要对以上两种样式分别进行设置。下面是一段示例代码: 复制代码 代码如下:var alpha = 30; //透明度值变量 var oDiv = document.getElementById(‘di