css实现弹出窗体始终垂直水平居中

<!DOCTYPE html><html>

<head>

<metacharset=" utf-8">

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

<title>蚂蚁部落</title>

<styletype="text/css">

body{

height:1000px;

}

.antzoen{

position:fixed;

width:250px;

height:100px;

background:#ececec;

left:50%;

top:50%;

margin-left:-125px;

margin-top:-50px

}

</style>

</head>

<body>

<divclass="antzoen"></div>

</body>

</html>

可是这样的方法ie6不支持fixed属性。可是如今大多不再考虑ie6。

所以尽能够放心使用。