下面是CSS I 'm using to try and position the #lower-content-sub div to stick to the bottom of my #content div. I' m试图将其定位为主页Home page!我喜欢它坚持到底部所以当内容div移动时,较低的内容将保持不变 .
有没有办法让儿童div比父母延伸更宽,但也可以坐在父母后面?
您可以在其中查看问题的页面是here .
下面是CSS:
#content {
width:990px;
height:auto;
min-height:540px;
background-color:#fff;
margin: -151px auto 0 auto;
-webkit-box-shadow: 0px 1px 30px rgba(50, 50, 50, 0.62);
-moz-box-shadow: 0px 1px 30px rgba(50, 50, 50, 0.62);
box-shadow: 0px 1px 30px rgba(50, 50, 50, 0.62);
}
#lower-content-sub {
height:250px;
width:100%;
background-color:#fff;
border-top: 5px solid #666;
border-bottom: 2px solid #666;
background-image:url(../images/noise.jpg);
}
和HTML
<div id="content"></div>
<div id="lower-content-sub">
</div>
1 回答
尝试应用此属性 .
到
#content
div设置position:relative;
到
#lower-content-sub
设置position:absolute; bottom:0;
和margin-top:250px;
(margin-top等于lower-content-sub height)希望它能引导您找到解决方案 .