【发布时间】:2021-02-17 08:58:18
【问题描述】:
主 div 和页脚之间有一个空格,我不明白它来自哪里以及如何调整它,我希望它是一个页脚向下页面,在主 div 之外。
#main {
border: solid;
width: 100%;
height: 2000px;
}
#container {
min-height: 100%;
position: relative;
top: 190px;
}
body {
padding: 10px;
padding-bottom: 60px;
/* Height of the footer */
}
#footer {
position: absolute;
bottom: 0;
width: 100%;
height: 40px;
/* Height of the footer */
text-align: center;
vertical-align: middle;
background-color: rgb(62, 45, 212);
color: white;
}
<div id="main"></div>
<div id="container">
<div id="footer">--------Footer--------</div>
</div>
【问题讨论】:
-
您需要澄清您的确切问题,因为它很难理解,但间距来自
top: 190px;