How to create mat-grid-list Angular Material
P粉473363527
P粉473363527 2023-08-18 12:56:40
0
2
480
<p>I'm trying to create a mat-grid-list using Angular Material, the problem is that I don't see anything appearing on the page</p> <p>This is my component info-section:</p> <pre class="brush:php;toolbar:false;"><div class="mat-grid-list" cols="4" rowHeight="100px"> <div class="mat-grid-tile" style="grid-column: span 1; grid-row: span 2; background-color: lightpink;"> Three </div> <div class="mat-grid-tile" style="grid-column: span 0; grid-row: span 0; background-color: lightgreen;"> Two </div> <div class="mat-grid-tile" style="grid-column: span 3; grid-row: span 1; background-color: #DDBDF1;"> Four </div> </div></pre> <p>Everything is installed and declared</p>
P粉473363527
P粉473363527

reply all(2)
P粉262113569

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粉903969231

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>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template