[英]Removing White-space after using “top” tag in CSS
我知道这可能是非常基本的,但是我似乎无法使其工作:/
在网站底部的页脚处,我有一个空白要删除。 我尝试使用margin-bottom
无济于事
还有什么我应该做的吗?
这是我的代码:
的HTML
<div id="footer">
</div>
<div id="bottombanner">
</div>
的CSS
#footer{
background: url("../images/footer.gif") no-repeat top left;
height: 370px;
overflow: hidden;
z-index: 1000;
position: relative;
}
#bottombanner{
background-color: rgb( 22, 47, 66 );
left: 0px;
width: 100%;
height: 60px;
top: -31px;
z-index: 1;
position: relative;
}
任何帮助将不胜感激!! 谢谢!
将#bottombanner
top
更改为margin-top
。
#bottombanner{
background-color: rgb( 22, 47, 66 );
left: 0px;
width: 100%;
height: 60px;
margin-top: -31px;/*this*/
z-index: 1;
position: relative;
}
将属性top:-31px
为margin-top:-31px;
适用于#bottombanner
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.