<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Div inside div vertical and horizontally center</title>
</head>
<body>
<div class="parent">
<div class="child">test</div>
</div>
</body>
</html>
div.parent {
display: table-cell;
width: 200px;
height: 200px;
background: #FFF;
vertical-align: middle;
text-align: center;
border: 1px solid #BBB;
}
div.child {
display: inline-block;
width: 50px;
height: 50px;
background: #DDD;
border: 1px solid #999;
}