How to Customize Bootstrap Column Widths?

前端 未结 6 806
我在风中等你
我在风中等你 2020-12-05 02:23

I have this, but I feel 4 is too big for my sidebar width and 3 is too small (it has to add up to 12).

  
6条回答
  •  时光取名叫无心
    2020-12-05 02:44

    Bootstrap 4.1+ version of Antoni's answer:

    The Bootstrap mixin is now @include make-col($size, $columns: $grid-columns)

    .col-md-8half {
      @include make-col-ready();
    
      @include media-breakpoint-up(md) {
        @include make-col(8.5);
      }
    }
    
    .col-md-3half {
      @include make-col-ready();
    
      @include media-breakpoint-up(md) {
        @include make-col(3.5);
      }
    }
    

    Source:

    • Official documentation
    • Bootstrap 4 Sass Mixins [Cheat sheet with examples]

提交回复
热议问题