<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 7 年前。
<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 7 年前。
在我的 work2 Website当页面中没有足够的内容时,我无法将页面中的页脚保持在底部。我已经用谷歌搜索过,在 youtube csstricks 等上搜索过。 但是总是有相同的“解决方案”; 但不适用于我的页面。现在我是来寻求帮助的。
我要的是this . 我真的很感激一个好的解决方案。
您真诚的。 迈克
最佳答案
您可以简单地实现链接中的代码。关键是:
bottom: 0
绝对定位因此,对于您的网站,您需要添加以下内容:
html {
height: 100%;
}
body {
position: relative;
min-height: 100%;
}
footer {
position: absolute;
bottom: 0;
height: 35px;
width: 100%;
}
.content {
padding-bottom: 60px;
}
刚刚通过将其附加到您的 style.css
文件在您的网站上对其进行了测试。
关于html - 将页脚放在网站的底部。 (不是位置 : fixed),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35096956/