如何解决将页脚保持在底部
我的代码中的页脚位于页面中间,我希望它动态移动到页面底部 .并且当我添加矩形时,页脚将移动到更多底部。 HTML:
<div id="wrapper">
<header>
<a href="index.html" id="logo"></a>
</header>
<nav class="index_nav">
<ul>
<li ><a href="index.html">Layout 1</a></li>
<li><a href="layout2.html">Layout 2</a></li>
<li class="selected"><a href="Layout3.html">Layout 3</a></li>
</ul>
</nav>
<main class="Rectangles">
</main>
<footer class="footer3">
</footer>
</div>
CSS:
.Rectangles {
display: flex;
flex-wrap: wrap;
width: 1000px;
position: relative;
}
.Rectangles>section {
cursor: pointer;
height: 350px;
width: 333px;
}
.footer3 {
position: relative;
height: 48px;
width: 100%;
background-color: #d6d6d6;
}
解决方法
将页脚的 css 更改为以下 1:
s
,
只需删除您的 position: relative;
并更改为 position: fixed;
或 position: absolute;
并刷新
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。