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那样?
...全文
347 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
scscms太阳光 2009-05-24
  • 打赏
  • 举报
回复
.child1{
background:#990099;
width:500px;
height:400px;
/*display:none;*/
position:absolute;
top:50px;
left:50px;

}

1,451

社区成员

发帖
与我相关
我的任务
社区描述
多媒体/设计/Flash/Silverlight 开发 图象工具使用
社区管理员
  • 图象工具使用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧