用css实现将div上下居中,水平居中
.dialog-container { //div的父容器
position: absolute;
top: 50%;
margin-top: -200px;
left: 0;
width: 100%;
}
#dialog { //div
width: 500px;
margin-left: auto;
margin-right: auto;
height: 245px;
}
.dialog-container { //div的父容器
position: absolute;
top: 50%;
margin-top: -200px;
left: 0;
width: 100%;
}
#dialog { //div
width: 500px;
margin-left: auto;
margin-right: auto;
height: 245px;
}