JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://www.jqplot.com/src/jquery.jqplot.min.js"></script>
<div class="lead">
<div class="message"></div>
</div>
CSS
html, body {
height:100%;
}
.lead {
width:100%;
height:100%;
background:red;
position:relative;
}
.message {
width:120px;
height:200px;
background:yellow;
position:absolute;
left:0;
bottom:0;
}
JavaScript
var homepageLead = function () {
var lead = $('.lead'),
message = $('.message'),
lead_height = lead.height(),
message_height = message.height(),
lead_center = .5 * lead_height,
message_center = .5 * message_height,
center = (lead_center - message_center);
return message.css('bottom', center);
};
$(function () {
$(window).resize(function () {
homepageLead();
}).resize();
});