Topic: Set mdb-card max height then add a scrollbar
1001albertpadilla asked 5 years ago
For mdb-card, how do I set max height for the mdb-card-body then add a scrollbar so the content won't overflow. Here's the code I have and the corresponding screenshot.
mdb-card mdb-card-body style="max-width: 20rem; max-height: 10rem; min-height: 10rem;"
Konrad Stępień staff answered 5 years ago
Can you try to use overflow: scroll
property?
1001albertpadilla commented 5 years ago
I'm not sure if I'm doing it right. I tried both of these and both didn't work.
mdb-card overflow="scroll"> mdb-card-body overflow="scroll">
Kindly help. Thanks.
Arkadiusz Idzikowski staff answered 5 years ago
I just checked that again and adding max-height and overflow: scroll works correctly. You need to add this styles to your styles.scss
file:
mdb-card-body {
max-height: 100px;
overflow-y: scroll;
}
or inline:
<mdb-card-body style="max-height: 100px; overflow-y: scroll">
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- User: Free
- Premium support: No
- Technology: MDB Angular
- MDB Version: 7.5.3
- Device: Laptop
- Browser: Chrome
- OS: Win 10
- Provided sample code: No
- Provided link: No