<分区>
我正在读这个 article about position ,我不明白为什么 in this example相对定位的 div 受 BODY 影响,但绝对定位的框忽略它?
当它们定位在另一个元素内时,它们的行为不应该相同吗?
CSS:
body {
display: block;
margin: 8px;
}
#box_1 {
position: relative;
width: 200px;
height: 200px;
background: #ee3e64;
}
#box_2 {
position: absolute;
top: 0;
left: 100px;
width: 200px;
height: 200px;
background: #44accf;
}