Bootstrap 4 - Responsive cards in card-columns

前端 未结 6 850
遇见更好的自我
遇见更好的自我 2020-11-29 20:27

I\'m playing with Bootstrap 4 and I can\'t find a solution to add responsiveness to cards while in a div with class=\"card-columns\" (this class ap

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-29 21:09

    I realize this question was posted a while ago; nonetheless, Bootstrap v4.0 has card layout support out of the box. You can find the documentation here: Bootstrap Card Layouts.

    I've gotten back into using Bootstrap for a recent project that relies heavily on the card layout UI. I've found success with the following implementation across the standard breakpoints:

    
    
    
    
    Mazda hatchback
    Card title

    Some quick example text to build on the card title and make up the bulk of the card's content.

    Go somewhere
    Mazda hatchback
    Card title

    Some quick example text to build on the card title and make up the bulk of the card's content.

    Go somewhere
    Mazda hatchback
    Card title

    Some quick example text to build on the card title and make up the bulk of the card's content.

    Go somewhere
    Mazda hatchback
    Card title

    Some quick example text to build on the card title and make up the bulk of the card's content.

    Go somewhere
    Mazda hatchback
    Card title

    Some quick example text to build on the card title and make up the bulk of the card's content.

    Go somewhere

    After trying both the Bootstrap .card-group and .card-deck card layout classes with quirky results at best across the standard breakpoints, I finally decided to give the .card-columns class a shot. And it worked!

    Your results may vary, but .card-columns seems to be the most stable implementation here.

提交回复
热议问题