<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Html基础</title>
<style>
#max{
width: 600px;
height: 2000px;
background-color: aqua;
border: 1px black solid;
margin: 0 auto;
/* 不设置偏移给下级当 '指挥棍' 下级设置absolute偏移以此为准 */
/* position: relative; */
}
#div1{
width: 200px;
height: 200px;
background-color: red;
border: 1px black solid;
/* 上一级位置基础下定位 */
/* position: relative;
left: 100px;
top: 200px; */
/* 根据网页显示内容处定位 */
position: absolute;
left: 100px;
top: 200px;
/* 根据浏览器窗口来定位 */
/* position: fixed;
left: 50px;
top: 30px; */
}
</style>
</head>
<body>
<div id="max">
<div id="div1">
</div>
</div>
</body>
</html>