绝对定位的层上下左右居中

left:50%;
top: 50%;
margin-left:-xx px!important;/*元素width的一半*/
margin-top:-xx px!important;/*元素height的一半*/
margin-top:0px;
position:fixed!important;
position:absolute;
_top:expression(eval(document.compatMode &&   
        document.compatMode=='CSS1Compat') ?   
        documentElement.scrollTop   
        +(documentElement.clientHeight-this.clientHeight)/2
        : document.body.scrollTop   
        +(document.body.clientHeight-this.clientHeight)/2); /*ie6*/
posted @ 2012-06-11 11:53  纯属偶然_黄勇  阅读(624)  评论(0编辑  收藏  举报