gpt4 book ai didi

css - 页脚不会粘在底部

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

我正在构建一个网站,页脚不会粘在底部。有人可以帮我解决这个问题吗?

CSS

#footer {
background-color: #454245;
bottom: 0;
float: right;
height: 200px;
left: 0;
margin-top: auto;
overflow: hidden;
position: relative;
width: 100%;
}

最佳答案

像这样尝试: LINK

HTML:

<div class="wrapper">
<p>Your content goes here.</p>
<div class="push"></div>
</div>
<div class="footer">
<p>Footer content</p>
</div>

CSS:

* {
margin: 0;
}
html, body {
height: 100%;
}
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -155px; /* the bottom margin is the negative value of the footer's height */
}
.footer,.push{
background-color:#ccc;
height: 155px;
}

关于css - 页脚不会粘在底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24407955/

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