为什么我的Bootstrap Jumbotron失去了左边的填充?

时间:2017-06-16 16:26:28

标签: twitter-bootstrap

Jubtotron的最小例子。左右填充消失了。

https://jsfiddle.net/3azmutot/1/

<div class="jumbotron">
<h1>Jumbotron</h1>
<p>Now is the time for all good men to come to the aid of the party.</p>
</div>

它在文档中有填充。 http://getbootstrap.com/components/#jumbotron

2 个答案:

答案 0 :(得分:1)

您的jumbotron需要位于具有“容器”类的元素中才能应用填充。

<div class="container">
    <div class="jumbotron">
        <h1>Jumbotron</h1>
        <p>Now is the time for all good men to come to the aid of the party.</p>
    </div>
</div>

https://jsfiddle.net/3azmutot/2/

答案 1 :(得分:0)

如果您希望jumbotron为全宽,请像这样添加.container:

<div class="jumbotron">
    <div class="container">
        <h1>Jumbotron</h1>
        <p>Now is the time for all good men to come to the aid of the party.</p>
    </div>
</div>