[英]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.