JSFiddle - React, Tailwind, and code Playground

HTML

<div id="big"></div>
<div id="small"></div>

CSS

#big {
    width: 600px;
    height: 800px;
    background: green;
    margin: 50px;
}
#small {
    background: red;
    width: 200px;
    height: 200px;
    position: absolute;
}

JavaScript

var $big = $('#big'),
    $small = $('#small');

$small.css({
    top: $big.offset().top + $big.height() - $small.height(),
    left: $big.offset().left + ( ($big.width() - $small.width()) / 2 )
});