<!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。

所以尽能够放心使用。

相关文章:

  • 2021-12-01
  • 2021-12-03
  • 2021-11-27
  • 2021-12-05
  • 2021-12-13
  • 2021-11-23
猜你喜欢
  • 2021-08-31
  • 2021-10-10
  • 2022-01-03
  • 2022-01-30
  • 2022-02-11
  • 2022-12-23
  • 2021-12-31
相关资源
相似解决方案