将网站中所有的内容居中,意思就是说,无论用户的屏幕是什么样子的,所显示的内容是在屏幕中间的。显示出来的 样子  就是和   新浪的那个是一样的。并且网页中的内容的相对位置不能改变。
非常感谢 !~~     c# 的 和  Vb 的 麻烦都讲一下是怎么实现的     谢谢 

解决方案 »

  1.   

    这个直接在body用个div 设置属性style="margin:0 auto; width:1002px" 就OK了
      

  2.   


    <body>
        <center>其他内容</center>
    </body>
      

  3.   

    以下肯定没问题!!
            <div style=" width: 500px; position: static; top: 100px;margin:0 auto; height: 212px; background-color: #ffccff" >
             </div>
      

  4.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head>    <title>Untitled Page</title>    <style type="text/css">        * {         margin:0px auto;         text-align:center;        }        .Demo {         height:800px;         width:900px;         border-style:solid;         border-width: 1px;         border-color:#D9D4D1;        }    </style></head><body>     <div class="Demo">    </div></body></html>