【问题标题】:md-card : How to align contents in row and column inside md-card-content?md-card:如何在 md-card-content 中对齐行和列中的内容?
【发布时间】:2017-05-29 11:15:43
【问题描述】:

如何将下面的 md-card-content 对齐为 2 行 2 列?我希望 ID 和值显示在单行中,时间和结果显示在第二行中。

   <md-card-content>
    <h2>ID:</h2>
    <h2>Value:</h2> 
    <h2>Time:</h2> 
    <h2>Result:</h2>
    </md-card-content>

【问题讨论】:

    标签: angularjs angular-material angular-material2


    【解决方案1】:

    执行这些样式并确保覆盖材质样式而不是替换除这些元素之外的其他元素。

    md-card-content {
        display: flex;
        font-size: 0;
        flex-wrap:wrap;
        margin:-10px 0 0 -10px;
    }
    h2 {
        display: inline-block;
        background:blue;
        margin:10px 0 0 10px;
        flex-grow: 1;
        min-height:100px; // or max-height as per your requirement
        width: calc(100% * (1/2) - 10px - 1px)
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-01-04
      • 2017-06-18
      • 2017-10-07
      • 1970-01-01
      • 2018-03-09
      • 2019-08-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多