JSFiddle - React, Tailwind, and code Playground

HTML

<h1>Centering width display:box</h1>
<div class="parent">
     <div class="child">
         PINK SQUARE SHOULD BE CENTERED.
         BOTH VERTICALLY AND HORIZONTALLY
    </div>
</div>

CSS

h1 {   font: 13px Verdana;    }

.parent {
   background: linen;
   width: 300px;  
   height: 300px; 
   display: -webkit-box;
   display: -moz-box; 
   display: box; 
   -webkit-box-pack: center;
   -webkit-box-align: center;
   -moz-box-pack: center;
   -moz-box-align: center; 
    box-pack: middle;
    box-align: middle;
}

.child {
    background: pink;  
    width: 200px; 
    height: 200px;
}