css 100vh未将div设置为100%高度

时间:2016-04-21 12:06:29

标签: html css html5 css3

如下面的截图

所示

enter image description here

视口高度约为97%而不是100%。可以看到下一节。我现在坚持这个问题几个小时,下面是我的CSS和HTML代码

CSS

html, body {
     width: 100%;
    height: 100%;
}

.section-3 {
    background: url(../images/section-3-bg.jpg) center center;
    background-size: cover;
    position: relative;
    height:100vh;
}

HTML

<section class="section-3 col-xs-12" id="demand">
    <section class="container">
        <center>
            <div id="trapezium"></div>
                <h1 class="blue big-font">On Demand Charters</h1>
                <img src="images/demand-border.png" alt="" class="img-responsive" style="width:auto;">
                <div class="col-md-7 col-md-push-2">
                <p class="medium-font">With Powerfly, access a range of aircraft from light 
                                       to large jets, turboprops and helicopters 
                                       either through on-demand charters. All you need to
                                       do is book and a Powerfly executive will customise
                                       your plan as per your needs.
                </p>
                <h2 class="explore-btn"><a href="demand.html">Details</a></h2>
            </div>
        </center>
    </section>
</section>

2 个答案:

答案 0 :(得分:1)

真正的问题是旋转木马!

#carousel-generic-1 {
    margin-top: 0;
}

答案 1 :(得分:0)

它工作得很好..你没有拍摄section的完整截图,但实际上它取代了应有的位置。

但是,由于height: 100vh;

,它会切断按钮

enter image description here