Home > Mobile >  Angular Material Grid List not fitting height of content
Angular Material Grid List not fitting height of content

Time:11-10

Im building a grid with material and inside have a list of items. Grid is responsive.

When trying to stretch for smaller screens the content of each column is not diplayed at all but has a fixed height.

enter image description here

enter image description here

Demo :

https://stackblitz.com/edit/angular-demo-mat-grid-7mf3kr?file=app/demo/demo.component.css,app/demo/demo.component.ts,app/demo/demo.component.html,app/header/header.component.html

CodePudding user response:

You are using <mat-grid-list> that based on grid system so there is no way Angular Material Grid List can fit height of content.

You can use display: flex with div instead of <mat-grid-list> component and define the @media query when screen's width reaches 400px to set 1 item per row instead of 3.

  • Related