<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>aa</title>
<style>
*{padding: 0;
margin: 0;}
.per{
width: 300px;
height: 300px;
background: red;
}
.son{
width: 100px;
height: 100px;
background: blue;
position: inherit;
left: 100px;
top: 100px;
}
</style>
</head>
<body>
<div class="per"></div>
<div class="son"></div>
</body>
</html>
因为你外层得DIV并没有包裹内层得DIV,DIV是块级元素,自然会显示出两行
<div class="per">
<div class="son"></div>
</div>
这么写