<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>定位</title>
<style type="text/css">
.div1{
100px;
height: 100px;
background: #ffff00;
float: left;
}
.div3{
100px;
height: 100px;
background: rebeccapurple;
float: left;
position: relative;
}
.div2{
100px;
height: 100px;
background: #000080;
/*position: relative;*/
position: absolute;
top:50px;
left: 50px;
float: left;
}
/*body{*/
/*margin: 0;*/
/*padding: 0;*/
/*}*/
</style>
</head>
<body>
<div class="div1"></div>
<div class="div2"></div>
<div class="div3"></div>
</body>
</html>