今天我一直在尝试设计一个页脚,我一直在尝试通过 CSS 来实现,但无论我如何尝试,它都不会移动到底部。这是我目前拥有的:
#footer {
position: absolute;
bottom: 0;
width: 100%;
height: 60px;
background-color: red;
}
<div id="footer">
<p>TEST TEKST</p>
</div>
这是结果:
最佳答案
试试这个
body {
padding: 0;
margin: 0;
min-height: 100vh;
}
#footer {
position: absolute;
bottom: 0;
left: 0;
background: red;
width: 100%;
height: 50px;
}
<body>
<div id="footer"></div>
</body>
关于html - 页脚不会移动到页面底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52422485/