JSFiddle - React, Tailwind, and code Playground

by ewa

HTML

<div id="parentDiv">
    <header id="childDiv">
        <div id="anotherDiv"></div>
    </header>
    <div id="spaceDiv"></div>
</div>

CSS

html, body {
    height:100%;
}
body {
    width:100%;
}
#parentDiv {
    background:#ccc;
    height:100%;
    width:100%;
    float:left;
}
#childDiv {
    background:#333;
    padding:0 12%;
    height:inherit;
}
#anotherDiv {
    width:100px;
    height:100px;
    background:#000;
    position:relative;
    top:48%;
}
#spaceDiv {
    width:100%;
    height:2000px;
    background:#f00;
}

JavaScript

$(document).ready(function () {
    var divHeight = $('#parentDiv').height();
    alert(divHeight);
});