关于height:auto;的问题
时间:2010-05-13
来源:互联网
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>无标题页</title>
<style type="text/css">
#box_1, #box_2 {position:relative; width:300px; height:100px;margin:10px; background:#ddd;}
#box_1 { z-index:100;}
#box_2 { z-index:1;}
#a, #b {position:absolute; width:100px; height:100px; }
#a {background:#c00; }
#b {background:#0c0; left:50px;}
</style>
</head>
<body>
<div id="box_1">
<div id="a">这是第一个块</div>
</div>
<div id="box_2">
<div id="b">这是第二个块</div>
</div>
</body>
</html>
如果#box_1, #box_2 {position:relative; width:300px; height:100px;margin:10px; background:#ddd;} 中的 height:100px改成height:auto;box_1和box_2就重叠在一起,如何解决这个问题。我要做的这个必须要用到height:auto;请各位高手帮帮忙。
作者: yxz860123 发布时间: 2010-05-13
作者: noboat945 发布时间: 2010-05-13
作者: yxz860123 发布时间: 2010-05-13
提示:您可以先修改部分代码再运行
作者: cwq2jxl 发布时间: 2010-05-13
作者: AyumiHamasaki 发布时间: 2010-05-13
中height为auto;
作者: yxz860123 发布时间: 2010-05-13
作者: yxz860123 发布时间: 2010-05-13
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28