How to get bootstrap 4 24 grid

有些话、适合烂在心里 提交于 2019-11-28 05:37:51

问题


Does anyone know where to download 24 grid version of newest bootstrap 4-0-0 beta? I don't want to use sass, and I cant find customize option in bootstrap website.


回答1:


You can create 24-columns grid using the auto-layout columns, or by combining the 12-column grid..

https://www.codeply.com/go/nnf7toD1E2

 <div class="row">
        <div class="col">
            1
        </div>
        <div class="col">
            2
        </div>
        <div class="col">
            ..
        </div>
        <div class="col">
            24
        </div>
 </div>

Or, you can generate a custom CSS build by changing the $grid-columns variable to 24.




回答2:


Unfortunately, there is no customization tool in Bootstrap 4 so custom build is a necessary step.

But don't worry, it's quite easy.

  1. Follow instructions from this answer - https://stackoverflow.com/a/47251052/1614120 (you'll need Node.js installed)
  2. Put following code in the name.scss (file mentioned in 5th step):

name.scss

@import "bootstrap/scss/functions";
@import "bootstrap/scss/variables";
@import "bootstrap/scss/mixins";

$grid-columns: 24; // This overrides default value (12)
@import "bootstrap/scss/grid";
  1. Compile (step 7).

If you need any other Bootstrap components apart from the grid, see step 5 of the instructions.



来源:https://stackoverflow.com/questions/46258947/how-to-get-bootstrap-4-24-grid

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!