作者:

IE6 浮动后紧接着绝对定位

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
body, div{margin:0;padding:0;border:0;}

.tp{width:102px;height:100px;position:relative;z-index:0;   border: 1px red solid; }
.tleft{float:left;width:100px;height:100px;}

.tabs{position:absolute;left:0;top:0;width:50px;height:50px;   border: 3px red solid;}
</style>
</head>
<body>
<div class=”tp”>
    <div class=”tleft”></div>
    <div class=”tabs”></div>
</div>

</body>
</html>

当浮动父容器宽度空隙小于3像素时,会导致绝对定位元素无法显示出来.

发表评论

评论