JSFiddle - React, Tailwind, and code Playground

HTML

<div id='container'>
    <div id='content'></div>
</div>

CSS

#container { 
    position: absolute; top: 10px; left: 100px; width: 300px; height: 100px; border: 3px solid #666; 
    text-align: center; 
}
#content { display: inline-block; height: 94px; border: 3px solid #99ccff; 
    margin: 0 auto; 
}

JavaScript

/* This script here is only to demonstrate content with various width, it won't be used in production */
$(function(){
    ResizeContent();
});
function ResizeContent(){
    $('#content').width(Math.floor((Math.random()*150)+20));
    setTimeout(ResizeContent, 1000);
}