JSFiddle - React, Tailwind, and code Playground
HTML
<div class="parent">
<div class="child">I'm vertically centered multiple lines of text in a container. Centered with a ghost pseudo element</div>
</div>
CSS
.parent {
background: white;
height: 300px;
margin: 20px;
width: 300px;
position: relative;
resize: vertical;
overflow: auto;
}
.child {
position: absolute;
top: 50%;
left: 20px;
right: 20px;
background: black;
color: white;
padding: 20px;
transform: translateY(-50%);
resize: vertical;
overflow: auto;
}