Reputation: 497
I've use mat-card, in that I've used mat-card-title, for that I've used style="text-align:center";
but it's not aligning center
<mat-card style="text-align: center;">
<mat-card-header >
<mat-card-title style="text-align: center;">
spreadsheet
</mat-card-title>
</mat-card-header>
<mat-card-content>
<div id="spreadsheet"></div>
</mat-card-content>
</mat-card>
And this is the screenshot of the browser:
Upvotes: 3
Views: 10247
Reputation: 51
html file:
<mat-card class="title_center">
<mat-card-title>spreadsheet</mat-card-title>
</mat-card>
css file:
.title_center {
display: flex;
justify-content: center; /* align horizontal */
align-items: center; /* align vertical */
}
Upvotes: 5
Reputation: 294
Text align not having effect because mat-header tag only having the width of its content. You can try like this
<mat-card >
<div style="text-align:center;">
<mat-card-title>spreadsheet</mat-card-title>
</div>
<mat-card-content>
<div id="spreadsheet">
</div>
Upvotes: 2