JSFiddle - React, Tailwind, and code Playground
HTML
<div class="window">
<div class="rect"></div>
</div>
CSS
.window
{
width: 640px;
height: 480px;
background: gray;
position: absolute;
-webkit-transform: translate(-25%, -25%) scale(0.5);
}
.rect
{
width: 60px;
height: 40px;
background: red;
}
JavaScript
$(function() {
$('.rect').draggable({
containment: 'parent'
});
});