JSFiddle - React, Tailwind, and code Playground

Equal div Heights

by Jennifer Perrin

HTML

<div class="maxHeight">
    Lorem ipsum dolor sit amet, duc quia iuvenis est se est amet coram posset fertur ardeat in! Audite deo hanc nec caecatus dum veniens Theophilum suum Heu enim est Apollonius eius in lucem genero in.
</div>  
<div class="maxHeight">

</div>

CSS

body { margin: 3%; }

.maxHeight { 
    background: #f0f0f0; 
    width: 100px; 
    float: left; 
    padding: 2%; 
}
.maxHeight:first-of-type { background: #dcdcdc; }

JavaScript

var max_height = 0;
$(".maxHeight").each(function () {
    if ($(this).height() > max_height) {
        max_height = $(this).height();
    }
});
$(".maxHeight").height(max_height);