下图显示的情况,是针对以下一段 html 标记设计制作的,其结构代码如下: div1 div2 div3 其对应的 CSS 样式表代码为:
A.
div{ width:100px; height:50px; background: pink; margin-bottom: 10px; } .div1{ position: relative; left: 150px; top:100px; }
B.
.father{ margin:0 auto; width:300px; height:200px; background:yellow; } .div1,.div2,.div3{ width:100px; height:50px; background: pink; margin-bottom: 10px; } .div1{ position: absolute; left: 150px; top:100px; }
C.
.father{ margin:0 auto; width:300px; height:200px; background:yellow; } .div1,.div2,.div3{ width:100px; height:50px; background: pink; margin-bottom: 10px; } .div1{ position: relative; left: 150px; top:100px; }
D.
div{ width:100px; height:50px; background: pink; margin-bottom: 10px; } .div1{ position: relative; left: 150px; top:100px; } .div2,.div3{ margin-bottom: 100px; left: 10px; top:100px; }