IE6中div定位,div嵌套,外部div的大小被内部的div撑开了
摇滚设计师 2009-05-22 01:35:43 <!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=gb2312" />
<title>无标题文档</title>
<style>
<!--
.child1{
background:#990099;
width:500px;
height:400px;
/*display:none;*/position:relative;
top:50px;
left:50px;
}
.father{
width:300px;
height:200px;
background:#000000;
margin:0 auto;
}
-->
</style>
</head>
<body>
<div class="father">
<div class="child1"></div>
</div>
</body>
</html>
=======================================
简单的代码如上
在IE7上能达到想要的效果,不过在IE6上怎么才能想IE7那样?