JSFiddle - React, Tailwind, and code Playground
by Pawel
HTML
<div class="d0">
<div class="table">
<div class="tablecell">
<div class="inner-div">
Lorem ipsum
dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
</div>
</div>
</div>
</div>
CSS
/* some wrapper */
div.d0 {
background: grey;
width:200px;
height: 200px;
}
div.table {
margin: 0 auto; /* just cosmetics */
width: 150px;
height: 150px;
background: #eee;
display: table;
}
div.tablecell {
display: table-cell;
vertical-align: middle;
text-align:center;
height: 100%;
width: 100%;
background: #aaa;
}
div.inner-div {
height: 150px;
overflow: hidden;
}