如何让一个DIV浮动在另一个DIV上面

直接上DEMO了

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<style type="text/css">
<!-- 
.d1 {
        position:absolute;
        top:20px;
        left:20px;
        width:200px;
        height:200px;
        background:red
        }
.d2 {
        width:500px;
        height:100px;
        background:blue;
        }

-->
</style>
<div class="d1"></div>
<div class="d2"></div>
原文地址:https://www.cnblogs.com/linuxnewbie/p/4789309.html