JSFiddle - React, Tailwind, and code Playground
HTML
<ul>
<li>
<p>Some Text</p>
</li>
<li>
<p>A bit more text that goes on 2 lines</p>
</li>
<li>
<p>Even more text that demonstrates how lines can span multiple lines</p>
</li>
</ul>
CSS
li {
/* This is the code responsible for the centering of content */
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-flex-pack:center;
-webkit-justify-content:center;
-moz-justify-content:center;
-ms-flex-pack:center;
justify-content:center;
-webkit-flex-line-pack:center;
-ms-flex-line-pack:center;
-webkit-align-content:center;
align-content:center;
-webkit-flex-direction:column;
-moz-flex-direction:column;
-ms-flex-direction:column;
flex-direction:column;
text-align: center;
width: 200px;
height: 200px;
margin: 0 1em 1em 0;
padding: 1em;
background: tomato;
border: 1px solid #333;
color: #fff;
font-family: "Helvetica";
font-size: 0.9em;
}
ul {
/* This lines the li's up in a row and will wrap them under each other */
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-flex-direction:row;
-moz-flex-direction:row;
-ms-flex-direction:row;
flex-direction:row;
-webkit-flex-wrap:wrap;
-moz-flex-wrap:wrap;
-ms-flex-wrap:wrap;
flex-wrap:wrap;
}