刚学h5不久,今天码代码时,想把两个小DIV铺在大的里边竟然重合了。。。
这到底是为什么?
有没有一种办法可以让前边class="2"的DIV里重叠几层,然后有和兄弟DIV1,平分父级呢?
谢谢!
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>
<body>
<div style="width:500px;height:800px;border:#000000 solid 2px;position:relative;">
<div class="2" style="width:500px;height:400px;background-color:#BD292C;">
<div class="1" style="width:500px;height:400px;background-color:#000000;"></div>
<div></div>
</div>
</div>
<div style="width:500px;height:800px;border:#000000 solid 2px;position:relative;">
<div class="2" style="width:500px;height:400px;background-color:#BD292C;">
<div class="1" style="width:500px;height:400px;background-color:#000000;"></div>
<div></div>
</div>
</div>
</body>
</html>

有没有一种办法可以让前边class="2"的DIV里重叠几层,然后有和兄弟DIV1,平分父级呢?
谢谢!
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>
<body>
<div style="width:500px;height:800px;border:#000000 solid 2px;position:relative;">
<div class="2" style="width:500px;height:400px;background-color:#BD292C;">
<div class="1" style="width:500px;height:400px;background-color:#000000;"></div>
<div></div>
</div>
</div>
<div style="width:500px;height:800px;border:#000000 solid 2px;position:relative;">
<div class="2" style="width:500px;height:400px;background-color:#BD292C;">
<div class="1" style="width:500px;height:400px;background-color:#000000;"></div>
<div></div>
</div>
</div>
</body>
</html>




乌蒙木子柒
