xxxxxxxxxx
.center {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
xxxxxxxxxx
// add to the parent element
.parent {
display: grid;
place-items: center;
}
xxxxxxxxxx
.center{
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
xxxxxxxxxx
.element {
position: absoloute;
margin: auto;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
xxxxxxxxxx
element {display: block; float: left; vertical-align: middle; text-align: center}
xxxxxxxxxx
<div><span style="display: inline-block;width: 30%"></span><span style="display: inline-block;
width: 30%;text-align: center;"> <button class="ml-3" mat-flat-button [color]="'primary'"
(click)="onSubmit()">
<mat-icon [svgIcon]="'oxalis:icon_save'"></mat-icon>Submit
</button></span><span style="display: inline-block;
width: 40%"></span></div>