Bootstrap gaps between columns

后端 未结 4 1454
孤城傲影
孤城傲影 2021-01-16 08:38

See: http://www.anniestasjes.nl/40/producten.html?category=tassen I use bootstrap 3 for responsive layout. I get these huge gaps between products because sometimes the produ

4条回答
  •  旧巷少年郎
    2021-01-16 09:24

    Two simple ways to do this, that each come with their own downsides:

    1) Set a fixed height of the product container: .product{height:300px}. This only works if you know a maximum # of lines your product description will ever have.

    2) Put each row of products into their own .row:

    ... This only works if you're ok not having your rows dynamic (e.g. always 3 accross) which looking at your example I think you're not.

    A more dynamic way of handling this would be some javascript that reads the calculated height of the tallest .product container in a given row (not .row) and assigns that same height to it's neighbors... but this is beyond me at the moment:)

提交回复
热议问题