论坛首页 Web前端技术论坛

透明滤镜导致overflow:visible变为hidden

浏览 2719 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2009-07-30  
CSS
如下:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=GB2312"/>
<style>
	*{
		margin:0px;
		padding:0px;
	}
	#d01{
		/*IE有滤镜的时候这里会被当作hidden,导致显示区域被剪切,而其它浏览器没有这种情况*/
		/*另外补充一点,在IE下,不触发layout,透明滤镜不会生效*/
		overflow:visible;
		position:absolute;
		background:red;
		filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50);
		opacity:0.5;
		width:100px;
		height:100px;
	}
	#d02{
		position:absolute;
	}
</style>
</head>
<body>
	某些情况下,透明滤镜会使overflow:visible变成overflow:hidden,详细如下     (另外,IE下div会向左排列,其余浏览器都是换行...IE真是个奇怪的东西)
	<div id="d01">
		<div id="d02">
			<img src="http://khm2.google.cn/kh/v=41&x=13492&y=6207&z=14&s=Gal">
		</div>
	</div>
</body>
</html>

论坛首页 Web前端技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics