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

前端 未结 8 1533
小蘑菇
小蘑菇 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:01

    If you know how many thumbnails wide is your arrangement, then you can use

    to wrap thumbnails in groups of three (or N).

    Otherwise, the workaround would be to set a fixed height for the thumbnail element. On your example

    .thumbnail {
       height:420px; 
    }
    

    However, if your thumbnail height and text can vary a lot, then it will either look awkward or hide part of the img/label.

提交回复
热议问题