How to adjust gutter in Bootstrap 3 grid system?

前端 未结 3 1564
南旧
南旧 2020-12-02 18:38

The new Bootstrap 3 grid system is great. It\'s more powerful for responsive design at all screen sizes, and much easier for nested.

But I have one issue I could not

3条回答
  •  佛祖请我去吃肉
    2020-12-02 19:32

    You could create a CSS class for this and apply it to your columns. Since the gutter (spacing between columns) is controlled by padding in Bootstrap 3, adjust the padding accordingly:

    .col {
      padding-right:7px;
      padding-left:7px;
    }
    

    Demo: http://bootply.com/93473

    EDIT If you only want the spacing between columns you can select all cols except first and last like this..

    .col:not(:first-child,:last-child) {
      padding-right:7px;
      padding-left:7px;
    }
    

    Updated Bootply

    For Bootstrap 4 see: Remove gutter space for a specific div only

提交回复
热议问题