页脚没有显示在页面底部。我该如何解决?
/* FOOTER */
#footer {
position: relative;
bottom: 0;
background-color: black;
color: white;
width: 100%;
height: 5.5rem;
margin-left: -8px;
padding-right: 16px;
bottom: -8px;
}
<footer id="footer">
</footer>
您可以将位置更改为绝对位置。
position: absolute;
/* FOOTER */
#footer {
position: absolute;
bottom: 0;
background-color: black;
color: white;
width: 100%;
height: 5.5rem;
margin-left: -8px;
padding-right: 16px;
bottom: -8px;
}
.footer-text {
padding-left: 20px;
padding-top: 10px;
}
<footer id="footer">
</footer>