【发布时间】:2014-01-24 23:15:08
【问题描述】:
我有单页网站,其中第一部分主要部分应该是查看者屏幕/浏览器大小的 100%,第二部分应该在查看区域下方,因此当用户点击链接时,页面会向下滚动到第二部分。
我如何做到这一点。, 到目前为止我已经尝试过了,但它没有将最小高度设置为 100%
HTML:
<div class="container">
<div class="firsthalf">
this is the first part of the site
<a href="#help"> <i class="fa fa-question-circle fa-lg"></i>
<div class="notice">this is aligned to bottom of first half
</div></div>
</div>
<div class="container">
<div id="help" class="secondhalf">
<div class="col-md-8 col-md-offset-2">
<div class="well">
we are in second part of the site
</div>
<a href="#top" class="btn btn-default"><i class="fa fa-arrow-up "></i> Top</a>
</div>
</div>
</div>
CSS:
body, html {
height: 100%;
}
.firsthalf{
height:100%;
}
.notice{
margin-bottom:0%;
padding-bottom:5px;
}
.secondhalf{
margin-top:25%;
margin-bottom:50%;
padding-top:25px;
min-height:50%;
}
【问题讨论】:
标签: html css twitter-bootstrap height