I use material and flex-layout in my angular project. I have a mat-progress-spinner that I would like to center text inside of it. I got it somewhat there using position absolute but my problem is that this does not remain centered on different sized screens. Here is my code
child.component.html
<div>
<mat-progress-spinner mode="indeterminate" [strokeWidth]="2" [diameter]="192"></mat-progress-spinner>
<div class="message">{{ message }}</div>
</div>
child.component.scss
.mat-progress-spinner {
display: inline-block;
vertical-align: middle;
}
.message {
position: absolute;
text-align: center;
top: 49%;
left: 44%;
}
This is a child component that is centered in the parent using the following
parent.component.html
<div fxLayout="column" fxLayoutAlign="center center" fxFill>
<app-child></app-child>
</div>
Thanks