JSFiddle - React, Tailwind, and code Playground

by Mottie

HTML

<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.js"></script>

<div id="main"></div>
<div id="child"></div>

CSS

#main {
    width: 50px;
    height: 50px;
    margin: 0 auto;
    background: rgba(77, 77, 77, 0.5);
}
#child { 
    width: 50px;
    height: 50px;
    background: rgba(99, 99, 99, 0.5);
    position: absolute;
}

JavaScript

$('#child').position({
    of: $("#main"),
    my: 'left top',
    at: 'right bottom'
});