我正在使用 bootstrap 创建一个页面,该页面带有一个 jumbotron 顶部、一个 sidenav(附加到顶部)以及在 sidenav 中单击时上升到顶部的内容部分。功能上,一切正常,但定位主要内容需要帮助。
如果可能的话,我的目标是让在 sidenav 中单击的内容部分不会出现在页面的最顶部,而是出现在浏览器窗口顶部下方约 70 像素处。我可以轻松地将 70px 添加到每个部分的顶部,但是页面最终会在部分之间出现过多的空白。代码结构如下...
<body >
<!-- navigation header - fixed to top and transparent
================================================== -->
<!-- <header><ul><li><a></a><li><ul></header>-->
<!-- jumbotron
================================================== -->
<div class="container">
<div class="row-fluid" align="center">
<div class="jumbotron span12">
<!-- jumbotron content height: 800px -->
</div>
</div>
<!-- side nav
================================================== -->
<div class="row">
<div class="span3" id="side-nav" data-spy="affix" data-offset-top="760">
<ul class="nav nav-list">
<li><a href="#section_1_name">section 1</a></li>
<li><a href="#section_2_name">section 2</a></li>
<li><a> <!-- links to additional sections --> </a></li>
</ul>
</div>
<div class="span9 main-content">
<!-- Sample section 1
================================================== -->
<section id="section_1_name">
<div class="page-header">
<h1>header</h1>
</div>
<h3>Why you should do this</h3>
<p>It's so amazing you'll want to do it. It's so amazing you'll want to do it. It's so amazing you'll want to do it.</p>
<h3>Specfic Instructions</h3>
<p>lorem ispum ... </p>
</section>
<!-- Sample section 2
================================================== -->
<section id="section_2_name">
<div class="page-header">
<h1>header</h1>
</div>
<h3>Why you should do this</h3>
<p>It's so amazing you'll want to do it. It's so amazing you'll want to do it. It's so amazing you'll want to do it.</p>
<h3>Specfic Instructions</h3>
<p>lorem ispum ... </p>
</section>
<!-- Additional sections
================================================== -->
</div> <!-- end of row -->
</div> <!-- end span9 --->
</body>
在侧边导航中单击时如何让每个部分 X 显示在顶部下方 70px 的任何想法?