I'm using Angular 8 and Angular Material for layout.
I have a card with progress spinner
<mat-card>
<mat-card-content class="text-center">
<mat-progress-spinner class="text-center"
[color]="color"
[mode]="mode">
</mat-progress-spinner>
</mat-card-content>
</mat-card>

It is aligned on the left. I want to align center.
I tried adding text-center with CSS
.text-center {
text-align: center;
}
But this does not work. Isn't there any predefined class for aligning content in the Angular Material?
I found one on Google search: https://material.angularjs.org/latest/layout/alignment, But this is form Angularjs version.
You can do it whit flex, adding this css in your component:
mat-card-content {
justify-content: center;
display: flex;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With