How can I make a card deck with fixed-width cards?

前端 未结 3 1723
伪装坚强ぢ
伪装坚强ぢ 2021-02-05 15:30

I want to make a responsive card deck using Bootstrap 4 fixed-width cards. Here I have posted the code below, but it\'s not responsive. Why?

3条回答
  •  庸人自扰
    2021-02-05 16:13

    For a Bootstrap 4 card deck with fixed-width cards, do this:

    Put each card into a column with the classes col-auto mb-3 (auto-width column + margin-bottom with three units).

    To center them, add the justify-content-center class to the row.

    Here's a working code snippet (click "run code snippet" below and expand to full page):

    
    
    
    Card title
    Card subtitle

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

    Card link Another link
    Card title
    Card subtitle

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

    Card link Another link
    Card title
    Card subtitle

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

    Card link Another link
    Card title
    Card subtitle

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

    Card link Another link
    Card title
    Card subtitle

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

    Card link Another link
    Card title
    Card subtitle

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

    Card link Another link
    Card title
    Card subtitle

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

    Card link Another link

提交回复
热议问题