gpt4 book ai didi

css - Bootstrap 底部粘性页脚与网站重叠

转载 作者:太空宇宙 更新时间:2023-11-03 22:55:13 25 4
gpt4 key购买 nike

我正在使用以下标记创建底部版权横幅

<footer class="footer">
<div class="container">
<p class="text-muted">© Some Company</p>
</div>
</footer>

这是CSS

 /*         Sticky footer styles
-------------------------------------------------- */
html {
position: relative;
min-height: 100%;
}
body {
/* Margin bottom by footer height */
margin-bottom: 60px;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
/* Set the fixed height of the footer here */
height: 60px;
background-color: #f5f5f5;
}


/* Custom page CSS
-------------------------------------------------- */
/* Not required for template or sticky footer method. */

body > .container {
padding: 60px 15px 0;
}
.container .text-muted {
margin: 20px 0;
}

.footer > .container {
padding-right: 15px;
padding-left: 15px;
}

code {
font-size: 80%;
}

问题是它与网站内容的底部重叠。

我如何强制它进一步下降?

我对这个 CSS 不满意

  .navbar-fixed-bottom {
padding-top: 10px;
height: 5%;
}

最佳答案

增加内容容器的底部填充。

如果这是页面内容的规则(我不知道,因为您没有发布页面的完整 HTML 结构)...

body > .container {
padding: 60px 15px 0;
}

...然后将最后一个“0”更改为至少 60px(尝试不同的值):

body > .container {
padding: 60px 15px 80px;
}

关于css - Bootstrap 底部粘性页脚与网站重叠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38708690/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com