How to use bootstrap with 16 or 24 columns

后端 未结 10 720
轮回少年
轮回少年 2020-11-29 03:39

I need some help setting bootstrap 2.0.4 to be 16 or 24 column instead of the default 12 columns i can\'t understand what am i doing wrong i tried the customize option on th

10条回答
  •  离开以前
    2020-11-29 04:13

    Simple enough to alter in less - http://twitter.github.com/bootstrap/scaffolding.html#gridCustomization

    You'll want to change the variables there to what you want -

    e.g.

    @gridColumns: 24
    @gridColumnWidth: 30px
    @gridGutterWidth: 10px
    

    If using a fluid-grid, you'll want to change these variables proportionally too, otherwise span12 will still take up 100% of the width and span24 will take up 200%

    @fluidGridColumnWidth
    @fluidGridGutterWidth
    

    As stated:

    How to customize

    Modifying the grid means changing the three @grid* variables and recompiling Bootstrap. Change the grid variables in variables.less and use one of the four ways documented to recompile. If you're adding more columns, be sure to add the CSS for those in grid.less.

    You can change the variables and download the new css right here: http://twitter.github.com/bootstrap/download.html#variables

    Here's a compiled example that should work for 16 columns (haven't tested, let me know how it works): https://s3.amazonaws.com/intenex/bootstrap16columns.zip

提交回复
热议问题