JSFiddle - React, Tailwind, and code Playground
by rbrtsmith
HTML
<div class="unknown">
<div clasS="table">
<div class="table-cell">
<p> centered content</p>
</div>
</div>
</div>
CSS
.unknown {
height: 300px;
background: blue;
}
.table {
display: table;
width: 100%;
height: 100%;
}
.table-cell {
display: table-cell;
width: 100%;
vertical-align: middle;
}
p {
background: green;
}