JSFiddle - React, Tailwind, and code Playground

by Pointy

HTML

<div class=center-me>
    Hello world! This is a centered element.
</div>

CSS

* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}
html, body {
    height: 100%;
    background-color: #336699;
    padding: 0;
    margin: 0;
}
.center-me {
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    margin: 0 auto;
    background-color: white;
    border-radius: 15px;
    padding: 20px;
    width: 200px;
    text-align: center;
    -webkit-box-shadow: 2px 2px 6px rgba(0,0,0,0.3);
    -moz-box-shadow: 2px 2px 6px rgba(0,0,0,0.3);
    box-shadow: 2px 2px 6px rgba(0,0,0,0.3);
}