设置父级div为相对位置
设置子级div为绝对位置
代码如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<div style="width: 100%; height: 600px; border: 1px solid; position:relative">
<div style="width: 200px; height: 100px; border:1px solid; position: absolute; top: 30px; left: 60px;"></div>
</div>
</body>
</html>