JSFiddle - React, Tailwind, and code Playground
HTML
Height of Body is: <span id="height"></span>.
Height of Viewport is: <span id="viewportheight"></span>
<div style="height: 500px; background-color: red; width: 100px;"></div>
CSS
html, body {
min-height: 100%;
}
body {
background-color: lightblue;
}
JavaScript
$(function() {
$(window).resize(function() {
$('#height').text($('body').height());
$('#viewportheight').text($(window).height());
});
$('#height').text($('body').height());
$('#viewportheight').text($(window).height());
});