P粉2621135692023-08-19 11:35:20
You need to use Angular Material’s Grid List component. Not just CSS. Please refer to the exampleshttps://material.angular.io/components/grid-list/examples
P粉9039692312023-08-19 10:04:24
The grid-column and grid-row properties require appropriate span values to determine how many columns or rows a grid block should span.
<mat-grid-list cols="4" rowHeight="100px"> <mat-grid-tile colspan="1" rowspan="2" style="background-color: lightpink;"> Three </mat-grid-tile> <mat-grid-tile colspan="1" rowspan="2" style="background-color: lightgreen;"> Two </mat-grid-tile> <mat-grid-tile colspan="3" rowspan="1" style="background-color: #DDBDF1;"> Four </mat-grid-tile> </mat-grid-list>