首页 > Windows开发 > 详细

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

时间:2017-05-12 20:04:54      阅读:334      评论:0      收藏:0      [点我收藏+]
<!DOCTYPE html><html>
<head>
<meta charset=" utf-8">
<meta name="author" content="http://www.softwhy.com/" />
<title>蚂蚁部落</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
}
</style>
</head>
<body>
<div class="antzoen"></div>
</body>
</html>


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

所以尽能够放心使用。

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

原文:http://www.cnblogs.com/jhcelue/p/6846959.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!