【问题标题】:Creating list of cards of same height with flexbox使用 flexbox 创建相同高度的卡片列表
【发布时间】:2020-01-18 13:03:56
【问题描述】:

我正在尝试制作具有相同宽度和相同高度的卡片列表。 我正在使用 flex、bootstrap 和一些 adminlte 行。

我的问题是,当一些带有文本的标签比其他标签大时,卡片的高度会改变以填充内容,它们会变成不同的高度。

这是小提琴: https://jsfiddle.net/b5d8u06m/

标记 css

<style>
    .medicos {
                display: flex;
                flex-flow: row wrap;
                justify-content: space-between;
     }
    .medicos::after {
                content: "";
                flex: auto;
            }

    .item {
                flex: 1; 

     }

    .btn_hora {
                margin: 5px;
}
</style>

【问题讨论】:

  • display: inline-flex; 添加到.item

标签: html twitter-bootstrap flexbox


【解决方案1】:

【讨论】:

    【解决方案2】:
    .item {
        flex: 1;
        display: flex;
    }
    
    .widget-user-2 .widget-user-header {
        padding: 20px;
        border-top-right-radius: 3px;
        border-top-left-radius: 3px;
        height: 150px;
        max-height: 100%;
    }
    

    【讨论】:

      猜你喜欢
      • 2022-12-14
      • 2023-01-13
      • 2017-11-11
      • 2019-12-30
      • 2018-10-27
      • 2016-06-22
      • 1970-01-01
      • 2018-01-30
      • 1970-01-01
      相关资源
      最近更新 更多