yusimiao的专栏

水有了压力才有喷泉的壮观

css透明度的设置 (兼容所有浏览器)
.transparent_class {
      	filter:alpha(opacity=50);
      	-moz-opacity:0.5;
      	-khtml-opacity: 0.5;
      	opacity: 0.5;
     	overflow:hidden;
	background-color: #CAE1FF; 
	width: 100%; 
	height: 100%; 
	position: absolute; 
	left: 0; 
	top: 0; 
	display: none; 
	overflow: hidden;
     	z-index:100;
}


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 .
overflow: (1)visible:默认值。内容不会被修剪,会呈现在元素框之外。 (2):hidden:内容会被修剪,并且其余内容是不可见的。(3):scroll:内容会被修剪,但是浏览器会显示滚动条以便查看其余的内容。(4):auto:如果内容被修剪,则浏览器会显示滚动条以便查看其余的内容。(5):inherit:规定应该从父元素继承 overflow 属性的值
z-index:对于这个属性,我个人的理解是指网页的整体的一个层,和我们视线垂直的网页面,z-index的值越大,这个div离我们的实现就越近,也就是说在别的div的上面。

感谢原文出处:http://justcoding.iteye.com/blog/545301#comments;

阅读更多
个人分类: web前端
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

css透明度的设置 (兼容所有浏览器)

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭