<div class="outer-div"><div class="mid-div"><div class="center-div"></div></div></div>
body
{
background-color: #fcfcfc;
}
.outer-div
{
display: table;
position: absolute;
height: 100%;
width: 100%;
}
.mid-div
{
display: table-cell;
vertical-align: middle;
}
.center-div
{
margin: 0 auto;
width: 300px;
height: 100px;
background-color: #ddd;
border-radius: 3px;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.