用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;

}

 

posted on 2013-10-25 15:57  柠檬味红茶  阅读(132)  评论(0)    收藏  举报

导航