目录

如何 - 固定页脚


了解如何使用 CSS 创建固定/粘性页脚。


亲自试一试 »


如何创建固定页脚

示例

<style>
.footer {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  background-color: red;
  color: white;
  text-align: center;
}
</style>

<div class="footer">
  <p>Footer</p>
</div>
亲自试一试 »

提示:转到我们的 CSS 位置教程了解有关定位的更多信息。