gpt4 book ai didi

html - 如何阻止内容进入页脚下方

转载 作者:行者123 更新时间:2023-11-28 06:26:28 25 4
gpt4 key购买 nike

嘿,我已经为我的网站制作了一个页脚,但是当我添加一个新容器并说我将高度设置为 500 像素时,我似乎遇到了一个问题,它重叠在底部的页脚上,请检查图像

enter image description here

我的页脚 CSS

    .footer {
height: 200px;
border-top: 1px solid #d8d8d8;
position: relative;
bottom: 0;
}
.footer li {
text-decoration: none;
font-weight: bold;
list-style-type: none;
padding: 0;
margin-left: 0;
margin-top: 2px;
}
.footer h4 {
font-weight: bold;
margin-top: 30px;
}
* {
margin: 0;
}
html, body {
height: 100%;
}
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -4em;
}
.footer, .push {
height: 200px;
clear: both;
}
.more-info {
border-top: 1px solid #d8d8d8;
position: relative;
bottom: 0;
}
.more-info p {
font-weight: bold;
}

HTML

<div class="footer">
<div class="container">
<div class="row">
<div class="col-sm-6">
<h4>Links</h4>
<li><a href="index.html">Home</a></li>
<li><a href="courses.html">Courses</a></li>
<li><a href="sign-up.html">Sign Up</a></li>
<li><a href="log-in.html">Log In</a></li>
<li><a href="about.html">About</a></li>
</div>

<div class="col-sm-6">
<h4>Social Media</h4>
<li><a href="#">Facebook</a></li>
<li><a href="#">Twitter</a></li>
<li><a href="#">Youtube</a></li>
<li><a href="#">Instagram</a></li>

</div>
</div>
</div>
</div>

最佳答案

我认为这是因为您的 .wrapper 上的底边距为负数。您可以尝试将其更改为:

 .wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto;
}

关于html - 如何阻止内容进入页脚下方,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35254826/

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