<style>
.out {
position: relative;//相对div的定位
top: 30%;//相对div的border-top的距离,根据元素的高度,50%则为垂直居中;
}
</style>
万能居中法:


#name{

position:relative;

left:50%;

top:50%;

transform:translate(-50%,-50%);

}