Wie center vertikal mit Winkel-Flex-Layout?

Ich habe eine einfache login-Komponente und ich würde gerne vertikal-center, aber ich bin mir nicht sicher, wie das zu erreichen ist die Verwendung der Winkel-Flex-Layout-Bibliothek.

app.component.html

<router-outlet></router-outlet>

login.component.html

<div fxLayout fxLayoutAlign="center center">
    <mat-card fxFlex="30%">
        <mat-card-title>Login</mat-card-title>

        <mat-card-content fxLayout="column">
            <mat-form-field>
                <input matInput placeholder="Username">
            </mat-form-field>
            <mat-form-field>
                <input matInput placeholder="Password">
            </mat-form-field>
        </mat-card-content>

        <button mat-raised-button color="accent">Login</button>
    </mat-card>
</div>

Stile.scss

body{
    margin: 0;
    background-color: #eff2f5;
}

screenshot:
Wie center vertikal mit Winkel-Flex-Layout?

InformationsquelleAutor Christian | 2018-01-10
Schreibe einen Kommentar