簡體   English   中英

Angular 7 材質:水平對齊卡片

[英]Angular 7 Material: Horizontally align cards

如果我有更多(材料)卡片,它們就會垂直對齊。 怎么可能,從左到右水平對齊卡片?

您可以使用屬性fxLayout="row"

<div fxLayout="row"  fxLayoutGap="12px"  [style.margin-top]="'12px'">

STACKBLITZ 演示

我正在嘗試為“商店”制作一張水平卡片清單,並像這樣創建我的卡片。 盡管如此,我的卡還是垂直對齊的。

 <h1>Catalog</h1> <div fxLayout="row" fxLayoutGap="12px" [style.margin-top]="'12px'"> <mat-card> <mat-card-header> <mat-card-title>Balls</mat-card-title> </mat-card-header> <mat-card-content> <div> <div class="card" *ngFor="let product of products"> <img class="catalogImage" src="assets/img/basketball.png" /> <p class="catalogTitle"> {{product.name}} </p> <p class="catalogPrice"> ${{product.price}} </p> <p class="catalogDescription"> {{product.description}} </p> <p><button class="catalogCartBtn">Add to Cart</button></p> </div> </div> </mat-card-content> <mat-card-actions> </mat-card-actions> </mat-card> </div> 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM