JSFiddle - React, Tailwind, and code Playground

HTML

<div id="background">
    <div  id="draggable" style="display:inline-block">
        <div id="resizeable">
            <div contenteditable="true" id="message">
                Enter message..
            </div>
        </div>
    </div>
</div>

CSS

#background { background: red; width: 600px; height: 400px; margin: 0 auto; background-size: 600px 400px;}

#draggable { width: 250px; height: 150px; padding: 0.5em; opacity: 0.5; color: #000; background: #f0f0f0; }

#resizeable { width: 250px; height: 150px; }

JavaScript

$("#resizeable").resizable({
    containment: "#background"
});

$("#draggable").draggable({
    cursor: "crosshair",
    containment: "#background",
});