我有三个的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的高度显然是不同的,等等。有什么办法让这项工作?
在此先感谢:)