如何做 - 固定页脚
了解如何使用 CSS 创建固定/粘性页脚。
如何创建一个固定的页脚
示例
<style>
.footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: red;
color: white;
text-align: center;
}
</style>
<div class="footer">
<p>页脚</p>
</div>
自己动手试一试 »
提示: 访问我们的 CSS 定位教程以了解更多关于定位的信息。