vertikales ausrichten mit flexbox in IE11 und IE10

Wie man einen cross-browser-Lösung, wo ein element vertikal ausgerichtet?

http://jsfiddle.net/e2yuqtdt/3/

Das funktioniert in Firefox und Chrome, aber nicht im IE11

<div class="page_login">
    <div>vertical-align:center; text-align:center</div>
</div>

html, body {
    height:100%;
}

.page_login {
    display:flex;
    height:100%;
    width:100%;
    background:#303030;
}

.page_login > div {
    margin:auto;
    background:#fff;
    min-height:100px;
    width:200px;
}

update

Wenn das element zentriert ist höher als der viewport-Höhe, der hintergrund ist nur 100% und nicht 100% - scroll-Höhe

http://jsfiddle.net/e2yuqtdt/8/

html, body {
    min-height:100%;
    height:100%;
}

.page_login {
    display:flex;
    min-height:100%;
    height:100%;
    width:100%;
    background:#303030;
}

.page_login > div {
    margin:auto;
    background:#fff;
    height:800px;
    width:200px;
}

InformationsquelleAutor clarkk | 2015-01-02

Schreibe einen Kommentar