【发布时间】:2021-02-07 20:27:53
【问题描述】:
我的页脚位于页面底部,直到我在它之前添加了几个 div。我不确定为什么这会抛出我的代码。我不想使用 position: fixed ,因为我希望它位于底部,但只有在向下滚动到时才能看到,例如此页面上的页脚。
.gallerybox {
border: 4px solid rgba(54, 215, 183, 1);
width:30%;
height:200px;
float:left;
margin-left:10px;
margin-bottom:10px;
}
#footer {
width:100%;
height:100px;
background-color:lightgray;
bottom:0;
left:0;
position:relative;
}
<div id="holder">
<div id="body">
<p id="gallery">The Gallery</p>
<div class="gallerybox"></div>
<div class="gallerybox"></div>
<div class="gallerybox"></div>
<div class="gallerybox"></div>
<div class="gallerybox"></div>
<div class="gallerybox"></div>
<br>
<div id="footer">FOOTER</div>
</div>
</div>
【问题讨论】:
标签: html css position footer division