JSFiddle - React, Tailwind, and code Playground

by avrahamcool

HTML

<div class="Container">
        <div class="First">
            <p>The First div height is not fixed</p>
            <p>This Layout has been tested on: IE10, IE9, IE8, FireFox, Chrome, Safari, Opera. using Pure CSS 2.1 only</p>
        </div>
        <div class="Second">
            <div class="Wrapper">
                <div class="Centered">
                    <p>The Second div should always span the available Container space.</p>
                    <p>This content is vertically Centered.</p>
                </div>
            </div>
        </div>
    </div>

CSS

*
{
    margin: 0;
    padding: 0;
}

html, body, .Container
{
    height: 100%;
}

    .Container:before
    {
        content: '';
        height: 100%;
        float: left;
    }

.First
{
    /*for demonstration only*/
    background-color: #bf5b5b;
}

.Second
{
    position: relative;
    z-index: 1;
    /*for demonstration only*/
    background-color: #6ea364;
}

    .Second:after
    {
        content: '';
        clear: both;
        display: block;
    }

/*This part his relevant only for Vertically centering*/
.Wrapper
{
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: auto;
}
    .Wrapper:before
    {
        content: '';
        display: inline-block;
        vertical-align: middle;
        height: 100%;
    }

.Centered
{
    display: inline-block;
    vertical-align: middle;
}