using md-cards in a md-grid-list in Angular 2 material

与世无争的帅哥 提交于 2020-01-14 12:55:33

问题


I am new to angular 2 material design. What I am trying to achieve is to create a grid list using angular2 material and place md-cards inside md-grid-tile. Though the md-card have position:relative, they are overflowing the md-grid-tile. click this link, the cards are overlapping and they are overflowing the md-grid-tile in a md-grid-list

Following is the code that I have used:

<body>
    <md-toolbar layout="row"> <md-button class="menu">
    <md-icon md-svg-icon="menu"></md-icon> </md-button>
    <h3>Pipeline UI</h3>
    </md-toolbar>

    <md-grid-list cols="2" rowHeight="2:1" gutterSize="15px">
        <md-grid-tile layout-wrap *ngFor="let item of releaseType">
            <md-card flex layout-fill>
                <md-card-header>test1</md-card-header>
                <md-card-content>
            <stage [init]="item.submissions"></stage></md-card-content>
            </md-card>
        </md-grid-tile>
    </md-grid-list>
</body>

Any help to solve this is extremely appreciated :)


回答1:


From what I figured out,md-grid-tile creates inside another dom element called figure and one of its css rules is align-items: center;. I used:

md-grid-tile figure {
    align-items: flex-start!important;
}


来源:https://stackoverflow.com/questions/38922547/using-md-cards-in-a-md-grid-list-in-angular-2-material

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!