<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>POSITION</title>
</head>
<style>
#div1{
width:200px;
height: 300px;
border: 1px solid #b84d32;
}
#div2{
width:200px;
height: 300px;
border: 1px solid #0cb80b;
position: absolute;
top: 300px;
left: 200px;
}
#div3{
width:200px;
height: 300px;
border: 1px solid #4312b8;
position:absolute;
top: 600px;
left: 400px;
}
</style>
<body>
<div id="div1">
框一
</div>
<span id="div2">
框二
</span>
<span id="div3">
框三
</span>
<div id="parentDiv">
</div>
</body>
</html>
注意属性
position : 指定是相对 位置 还是绝对位置
相对位置 relative
绝对位置absolute
top : 顶部的距离
left : 左边的距离
大概效果图