清除浮动
.clearfix{
*zoom:1;
}
.clearfix:after{
content:"";
display:block;
clear: both;
height: 0;
visibility: hidden;
}
父元素高度已知,垂直居中
.v-center{
position: relative;
top:50%;
transform: translateY(-50%);
}
父元素宽度已知,水平居中
.h-center{
position: absolute;
left: 50%;
transform: translateX(-50%);
}