很多人答案是margin的外边缘
谷歌浏览器测试发现不是margin的外边缘,而是border的内边缘
<style>
* {
padding: 0;
margin: 0;
}
.box {
width: 200px;
height: 200px;
background-color: purple;
position: absolute;
padding: 10px;
border: 20px solid black;
margin: 20px;
box-sizing: border-box;
}
.box2 {
width: 100px;
height: 100px;
background-color: goldenrod;
position: absolute;
top: 20px;
left: 0;
}
</style>
</head>
<body>
<div class="box">
<div class="box2"></div>
</div>
</body>