JSFiddle - React, Tailwind, and code Playground
HTML
<div id="parent">
<div id="mydiv"></div>
</div>
CSS
#parent {
margin-top: 100px;
margin-left: 100px;
background-color: red;
width: 300px;
height: 300px;
}
#mydiv {
background-color: blue;
width: 100px;
height: 100px;
}
JavaScript
$("#mydiv").position({
of: $('#mydiv').parent(),
my: 'left top',
at: 'left top',
offset: '50 50'
});