我一直在经历
CSS Positions articles on Alistapart.下面的片段引起了我的注意,无法理解背后的理论.
在html / css下面显示两个框,一个在另一个上面.但是,如果我将#box_1的位置更改为绝对,那么#box_2会重叠#box_1.
#box_1 {
position: relative;
width: 200px;
height: 200px;
background: #ee3e64;
}
#box_2 {
position: absolute;
width: 200px;
height: 200px;
background: #44accf;
}
>另一个框(box_1)的位置如何影响另一个/兄弟div(box_2)的位置.是不是’绝对’应该永远绝对只是立即非静态父母?
>在上面的css中(在box_1中有“position:relative;”),如果我添加“top:0;”到#box_2,然后box_2似乎再次重叠.为什么会这样?