Bootstrap 3 grid with different height in each item - is it solvable using only CSS?

前端 未结 8 1545
小蘑菇
小蘑菇 2020-12-23 21:20

I\'m trying to make a grid of thumbnails, where each thumbnail has an image and a label. It works fine if all the labels have the same length, because then all the thumbnail

8条回答
  •  太阳男子
    2020-12-23 22:05

    you could use clear: left and apply it for each first child in row. For example if you have 4 items in row you can use:

    .my-row>:nth-child(3n+1) {  
      clear:left;
      background-color: red; // just to see if the first item in row is matched
    }
    

提交回复
热议问题