Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular Material mat-card width as inner text width

Card's width is always 100%.

Demo

I would adapt mat-card width to fit text width ( with some padding )

<mat-card>Simple card</mat-card>

like image 255
infodev Avatar asked Jan 01 '23 16:01

infodev


1 Answers

You should apply to mat-card the css I wrote below.

mat-card{
    width: fit-content;
}
like image 180
seyid yagmur Avatar answered Jan 03 '23 04:01

seyid yagmur