<div id="wrapper">
<div id="center"></div>
</div>
#wrapper {
display: table-cell;
vertical-align: middle;
border: 1px solid black;
height: 150px;
width: 600px;
}
#center {
margin: auto;
background: red;
height: 20px;
width: 20px;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.