.test{
width: 90%;
position: absolute;
margin: auto;
top:0;
bottom:0;
left:0;
right:0;
}
1.父节点:table-cell + vertical-align
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
.parent {
background-color: #0eabdf;
width: 300px;
height: 300px;
display: table-cell;
vertical-align: middle;
}
.child {
background-color: #fe6464;
}
</style>
</head>
<body>
<div class="parent">
<div class="child">child</div>
</div>
</body>
</html>