简体   繁体   English

Bootstrap Grid 不会填满空的地方

[英]Bootstrap Grid Doesn't Fill Empty Place

https://prnt.sc/sa63wm https://prnt.sc/sa63wm

You can see on the screenshot你可以在截图上看到

How can i fill the empty place with div elements?如何用 div 元素填充空白处? I tried display:inline-block or the other display things.我试过 display:inline-block 或其他显示的东西。 They didnt work.他们没有工作。

<div class="row">
    <div class="col-sm-3">
    </div>
    <div class="col-sm-3">
    </div>
    <div class="col-sm-3">
    </div>
    <div class="col-sm-3">
    </div>
    <div class="col-sm-3">
    </div>
    <div class="col-sm-3">
    </div>
    <div class="col-sm-3">
    </div>
    <div class="col-sm-9">
    </div>
</div>

Bootstrap's grid has excatly 12 column units. Bootstrap 的网格有 12 个列单元。 Whenever you exceed 12, it will wrap it in a new row.每当您超过 12 时,它都会将其包装在新行中。 It works, but you should exceed 12 columns in one row.它可以工作,但你应该在一行中超过 12 列。

So instead of doing it above, you should go with:因此,您应该使用 go 代替上面的操作:

<div class="row">
    <div class="col-sm-3">
    </div>
    <div class="col-sm-3">
    </div>
    <div class="col-sm-3">
    </div>
    <div class="col-sm-3">
    </div>
</div>
<div class="row">
 ... next columns

If you want to have them all in row, you should probably use only one row and then put your other content vertically, as your first column is very tall.如果您想将它们全部排成一行,您可能应该只使用一行,然后将其他内容垂直放置,因为您的第一列非常高。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM