0
我在我的首页上有一个jumbotron,它的效果很好。我有一个粘性的页脚,它也很好。直到我把它们放在一起。包裹类废墟jumbotron,但把它排除废墟页脚。内容也迷失在那里的混乱中。显然,对于超大号,我并不需要页脚坚持到底,因为超大号会将它推到底部,但是我需要它用于其他没有超大号的页面。Bootstrap,jumbotron和粘脚
此外,在任何人尝试用固定页脚回答之前,这并不是我所期待的。
html, body {
height: 100%;
margin: 0;
}
.wrap {
min-height: 100%;
width: 100%;
}
.footer {
position: absolute;
width: 100%;
margin-top:-150px;
height: 150px;
background: orange;
}
.jumbotron {
background-color: inherit;
position: relative;
height: 100%;
}
.container-full-bg {
width: 100%;
height: 100%;
max-width: 100%;
background-position: center;
background-size: cover;
background-color: red;
}
.container-full-bg .container, .container-full-bg .container .jumbotron {
height: 100%;
width: 100%;
}
<div class="wrap">
<div class="container-full-bg">
<div class="container">
<div class="jumbotron">
<div class="row">
<div class="col-sm-12">my jumbotron</div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-sm-12">
content<br/>content<br/>content<br/>content<br/>
content<br/>content<br/>content<br/>content<br/>content<br/>
</div>
</div>
</div>
</div><!--/wrap-->
<div class="footer">my footer</div>
大声笑谁投下我自己的答案,我自己的问题 – bwoogie