简体   繁体   中英

Angular 7 Material Card max-height and scrollable

I use a grid layout for my application. On the bottom left grid I'm using Material Cards. The cards have dynamic content which means that the height of the card is different. How do I set the maximum height of the cards, so that they don't get cut off at the end of the screen? And since the cards have a dynamic content, how do I make the cards scrollable?

在此处输入图片说明

add this to your css:

.mat-card {
  max-height: 100px;
  overflow-y: auto;
}

DEMO

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM