是否有可能將子女(C)放在其父母(B)之下,以及B的鄰居(C)之下?在其父母下的CSS職位的子女
這有點難以描述,你可以看例子here。
問題是將藍色div.inner
定位在紅色div.neighbor
以上並且綠色div.outer
下。
爲了說明:
HTML代碼:
<div class="neighbor"> </div>
<div class="outer">
<div class="inner"></div>
</div>
CSS代碼:
.neighbor{
background-color: red;
height: 500px;
width: 500px;
}
.outer{
background-color: green;
width: 300px;
height: 300px;
position: fixed;
top: 0px;
left: 0px;
}
.inner{
background-color: blue;
width: 100px;
height: 100px;
position: fixed;
top: 0px;
left:250px;
}
你能provied的圖像,顯示你正在試圖達到什麼? – idmean
要定位藍色div上方紅色和綠色下http://tinypic.com/r/2drbfk0/5 –
這是你想要的嗎? [小提琴](http://jsfiddle.net/PHPzF/3/)。 –