本帖最后由 agrxl 于 2014-09-07 21:42:34 编辑

解决方案 »

  1.   

    那是因为你的页面默认是居左的,与缩小没关。
    参考下:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
     <head>
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      <title> New Document </title>
      <style type="text/css">
      body{
    text-align:center;
      }
      .main{
    width:1024px;
    height:1024px;
    background:#FF0000;
    margin:0px auto 0px auto;
      }
      </style>
     </head> <body>
      <div class="main"></div>
     </body>
    </html>
      

  2.   

    定义margin:0 auto;可以实现左右居中
      

  3.   

    楼上正解 将div设置margin:0 auto;