JSFiddle - React, Tailwind, and code Playground
HTML
<div id="container">
<div id="content">
</div>
</div>
CSS
#container {
position: fixed;
background: lightblue;
top: 0; bottom: 0;
left: 0; right: 0;
display: flex;
align-items: center;
justify-content: center;
overflow: auto;
}
#content {
border: 1px solid green;
/* uncomment the hack below to get desired behavior */
/* margin: auto */
}
JavaScript
document.getElementById('content').innerHTML = [...Array(100).keys()].join('<br>')