舟格财经
您的当前位置:首页css实现弹出窗口始终垂直水平居中_html/css

css实现弹出窗口始终垂直水平居中_html/css

来源:舟格财经


< html >

< head >

< meta charset = " utf-8" >

< meta name = "author" content = " http://www.softwhy.com/" />

< title >蚂蚁部落

< style type = "text/css" >

body{

height:1000px;

}

.antzoen{

position:fixed;

width:250px;

height:100px;

background:#ececec;

left:50%;

top:50%;

margin-left:-125px;

margin-top:-50px

}

< body >

< div class = "antzoen" >



但是这种方法ie6不支持fixed属性,但是现在大多不再考虑ie6。所以尽可以放心使用。

版权声明:本文为博主原创文章,未经博主允许不得转载。

显示全文