【发布时间】:2016-01-15 20:16:20
【问题描述】:
好的,我无法理解 Bootstrap Affix component。如果/当页面滚动到内容顶部下方时,我的目标是在屏幕左下角(边缘)出现一个“返回顶部”链接。我的页面有一个固定在顶部的 NavBar 和一个用于正文的容器。以下是我所在位置的总体思路,但我也有 setup a JS Fiddle 来演示我的设置。我也不是定位专家,所以这也是我的问题的一部分。
<div class="navbar navbar-fixed-top">...</div>
<div class="content-container" id="top">
<p>Content that is longer than the viewport..</p>
<span id="top-link" data-spy="affix">
<a href="#top" class="well well-sm">Back to Top</a>
</span>
</div>
<style>
.navbar-fixed-top + .content-container {
margin-top: 70px;
}
.content-container {
margin: 0 125px;
}
#top-link.affix {
position: absolute;
bottom: 10px;
left: 10px;
}
</style>
【问题讨论】:
-
感谢@Justin 的建议,但由于本文/问题中未显示其他需求,我试图以“引导方式”进行操作。
标签: css twitter-bootstrap twitter-bootstrap-3