我有三個的div如下CSS:CSS DIV定位問題
div#container {
width: 780px;
}
div#photos {
width: 780px;
height: 300px;
}
div#content {
position: relative;
top: -106px;
width: 780px;
}
<div id="container">
<div id="photos">photos are here</div>
<div id="content">content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer</div>
</div>
我的問題是,因爲我已經設置內容層是頂:-106px有很大的差距underneith,當我想「容器」div在「content」div後立即結束。我試圖在「容器」div上設置margin-bottom:-106px,但這並沒有改變「容器」div的高度。
「content」div的高度顯然是不同的,等等。有什麼辦法讓這項工作?
在此先感謝:)