JSFiddle - React, Tailwind, and code Playground
HTML
<html>
<body>
<button>Click Multiple Times</button>
<div id="container">
<div id="contents">
Some text
</div>
</div>
</body>
</html>
CSS
#container {
border: 1px solid blue;
}
#contents {
border: 1px solid red;
}
JavaScript
$('button').click(function() {
// Set margin-top to 100% of HEIGHT
$('#contents').css('margin-top', $(this).parent().height() + 'px');
});