我正在BootStrap中构建一个站点,我的卷轴完全消失了。我现在无法上下滚动。这是为什么?我已经尝试过溢出,溢出,但我不明白我做错了什么。
HTML
<!-- Wrap all page content here -->
<div id="wrap">
<!-- Fixed navbar -->
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Sugoi!</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="Anime"><a href="#Anime">Anime</a></li>
<li class="Manga"><a href="#manga">Manga</a></li>
<li class="Jogos"><a href="#Jogos">Jogos</a></li>
<li class="Opiniao"><a href="#Opiniao">Opinião</a></li>
<li class="Outros">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Outros <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">AMV</a></li>
<li><a href="#">Cosplay</a></li>
<li><a href="#">Passatempos</a></li>
</ul>
</li></ul>
<ul class="pull-right nav navbar-nav">
<li><a href="#about">Sobre</a></li>
<li><a href="#contact">Contacto</a></li>
</ul>
</div>
</div>
<!-- Begin page content -->
<div class="container">
<div class="page-header">
<h1>Sugoi!</h1>
<div class="jumbotron">
<div class="container">
<a href="http://google.com"><h1>Persona 4 - The Animation</h1>
<p>Sabe mais!</p></a>
</div>
</div>
</div>
<p class="lead">Pin a fixed-height footer to the bottom of the viewport in desktop browsers with this custom HTML and CSS. A fixed navbar has been added within <code>#wrap</code> with <code>padding-top: 60px;</code> on the <code>.container</code>.</p>
<p>Back to <a href="../sticky-footer">the default sticky footer</a> minus the navbar.</p>
</div>
</div>
<div id="footer">
<div class="container">
<p class="text-muted credit">Example courtesy <a href="http://martinbean.co.uk">Martin Bean</a> and <a href="http://ryanfait.com/sticky-footer/">Ryan Fait</a>.</p>
</div>
</div>
</div>
CSS
/* Sticky footer styles
-------------------------------------------------- */
html,
body {
height: 100%;
/* The html and body elements cannot have any padding or margin. */
}
/* Wrapper for page content to push down footer */
#wrap {
min-height: 100%;
height: auto !important;
height: 100%;
/* Negative indent footer by its height */
margin: 0 auto -60px;
/* Pad bottom by footer height */
padding: 0 0 60px;
}
/* Set the fixed height of the footer here */
#footer {
height: 60px;
background-color: #f5f5f5;
}
/* Custom page CSS
-------------------------------------------------- */
/* Not required for template or sticky footer method. */
#wrap > .container {
padding: 60px 15px 0;
}
.container .credit {
margin: 20px 0;
}
#footer > .container {
padding-left: 15px;
padding-right: 15px;
}
code {
font-size: 80%;
}
.jumbotron {
background-image:url('http://tomodom.com/wp-content/uploads/2013/07/Persona4Golden_Hero.jpg');
height:400px
}
答案 0 :(得分:2)
具有固定位置的Div称为&#34;&#34;在页面内容之后不会关闭,该页面内容位于具有页脚ID的div之前。相反,它应该在导航部分的末尾完成。
复制此内容。
<!-- Wrap all page content here -->
<div id="wrap">
<!-- Fixed navbar -->
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Sugoi!</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="Anime"><a href="#Anime">Anime</a></li>
<li class="Manga"><a href="#manga">Manga</a></li>
<li class="Jogos"><a href="#Jogos">Jogos</a></li>
<li class="Opiniao"><a href="#Opiniao">Opinião</a></li>
<li class="Outros">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Outros <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">AMV</a></li>
<li><a href="#">Cosplay</a></li>
<li><a href="#">Passatempos</a></li>
</ul>
</li></ul>
<ul class="pull-right nav navbar-nav">
<li><a href="#about">Sobre</a></li>
<li><a href="#contact">Contacto</a></li>
</ul>
</div>
</div>
</div>
<!-- Begin page content -->
<div class="container">
<div class="page-header">
<h1>Sugoi!</h1>
<div class="jumbotron">
<div class="container">
<a href="http://google.com"><h1>Persona 4 - The Animation</h1>
<p>Sabe mais!</p></a>
</div>
</div>
</div>
<p class="lead">Pin a fixed-height footer to the bottom of the viewport in desktop browsers with this custom HTML and CSS. A fixed navbar has been added within <code>#wrap</code> with <code>padding-top: 60px;</code> on the <code>.container</code>.</p>
<p>Back to <a href="../sticky-footer">the default sticky footer</a> minus the navbar.</p>
</div>
</div>
<div id="footer">
<div class="container">
<p class="text-muted credit">Example courtesy <a href="http://martinbean.co.uk">Martin Bean</a> and <a href="http://ryanfait.com/sticky-footer/">Ryan Fait</a>.</p>
</div>
</div>