JSFiddle - React, Tailwind, and code Playground

HTML

<div id="hiddenParent" class="parent">
    <div id="hiddenChild" class="child">This is the hidden child</div>
</div>

<div id="visibleParent" class="parent">
    <div id="visibleChild" class="child">This is the visible child</div>
</div>

CSS

#hiddenParent {
    display: none;
}

#visibleParent {
    display: block;
}

.parent {
    height: 300px;
    width: 500px;
    background-color: green;
}

.child {
    width: 75%;
    height: 75%;
    background-color: yellow;
}

JavaScript

$(document).ready(function() {
    alert(window.getComputedStyle($('#hiddenChild')[0], null).getPropertyValue("height"));
    alert(window.getComputedStyle($('#visibleChild')[0], null).getPropertyValue("height"));
});