5 columns per row in Bootstrap-4

前端 未结 3 1280
忘了有多久
忘了有多久 2021-02-04 16:44

I have 15 records, I want to show all of it in a 5 columns per row. So I am using the auto column available in bootstrap 4 \".col\", is there a way to limit column counts per ro

3条回答
  •  梦毁少年i
    2021-02-04 16:52

    If you're working with Bootstrap 4 scss files, then the easiest way is to use default mixin make-col(x,y). For example this code in a layout of 5 columns will create element that covers width of 2 columns. Basically it's 2/5 = 40%:

    .my-col {
        @include make-col(2, 5);
    }
    

    This will result in following css:

    .my-col {
        flex: 0 0 40%;
        max-width: 40%;
    }
    

提交回复
热议问题