html, body { margin:0px auto 0px auto; padding:0px auto 0px auto;}
我这样写 想让页面布局居中 但是为什么IE里面可以 火狐不行 请问怎么改才能让两个浏览器都支持呢居中效果呢?

解决方案 »

  1.   

    body{TEXT-ALIGN: center;}
    #center{
    position:absolute;
    margin:-100px 0 0 -200px; 
    height:200px;
    width:400px;
    background:#F00;
    top:50%;
    left:50%;
    }
    </style>
    </head>
    <body>
    <div id="center"></div>
      

  2.   

    <style type="text/css"> 
    div,table { margin:auto; } 
    </style>FF不指定是靠左面。IE是居中。
      

  3.   

     body{margin:auto;width:778px;}<div style="background-color:#ccc;height:1000px">
        </div>
      

  4.   

    html,body{margin:0px;padding:0px;}
    <div style="margin:0px auto;width:1024px"></div>