当前位置:Gxlcms > html代码 > css实现弹出窗口始终垂直水平居中_html/css_WEB-ITnose

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

时间:2021-07-01 10:21:17 帮助过:17人阅读

< 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。所以尽可以放心使用。

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

人气教程排行