CSS 之 Opacity多浏览器透明度兼容处理
作者:互联网
css设置:
opacity{
filter:alpha(opacity=50); /* IE */
-moz-opacity:0.5; /* 老版Mozilla */
-khtml-opacity:0.5; /* 老版Safari */
opacity: 0.5; /* 支持opacity的浏览器*/
}
用javascript来设定一个元素为半透明:
object.filter = "alpha(opacity=" + opacity + ")"; /* IE */
object.MozOpacity = (opacity / 100); /* 老版Mozilla */
object.KhtmlOpacity = (opacity / 100); /* 老版Safari */
object.opacity = (opacity / 100); /* 支持opacity的浏览器*/
标签:Opacity,opacity,浏览器,老版,object,0.5,100,CSS 来源: https://www.cnblogs.com/zhongzhipeng/p/11375199.html