【发布时间】:2016-11-23 01:02:23
【问题描述】:
我想重新创建在http://www.akc.org/dog-breeds/ 找到的这种显着的粘性页脚效果
- 我知道必须修复页脚。
- 我知道内容需要有更高的
z-index - 我猜(有点)body 需要有一个
margin-bottom,它等于页脚的高度???
请有人帮帮我。
我正在使用 Twitter Bootstrap 4。一般标记如下所示:
<body>
<div class="container"> <!-- This part should scroll up to reveal the footer below -->
<!-- Content goes in here -->
</div>
<footer class="footer"> <!-- This should be hidden initially -->
<div class="container">
<div class="row">
<!-- Footer stuff goes in here -->
</div>
</div>
</footer>
</body>
【问题讨论】:
-
你不是刚刚在 1、2 和 3 中回答了你自己的问题吗?
-
可能,但我一直在玩它,还没有找到我想要的......
-
你说得对,容器需要位置:relative 和更高的 z-index,页脚固定,底部:0,并且 body 有 margin-bottom
标签: html css footer sticky-footer twitter-bootstrap-4