我在幻灯片中展示了一些 ionic 卡片,卡片的高度根据内容大小而变化。如何让它保持不变?
代码:
<ion-col *ngIf="types && types.length" no-padding>
<ion-slides slidesPerView="4">
<ion-slide nowrap *ngFor="let item of types">
<ion-card (click)="select(item.type)" style="height: 100%">>
<ion-label padding-top text-center text-wrap class="text4bl">{{ item.name }}</ion-label>
</ion-card>
</ion-slide>
</ion-slides>
</ion-col>
最佳答案
你可以像下面这样设置 ionic slider 的固定高度
ion-slides{
ion-slide {
height: 200px;
width: 100% !important;
ion-card{
height: 180px;
width: 100%;
}
}
}
关于css - ionic 卡恒定高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58275299/