CSS样式margin:0 auto不居中

<style type="text/css">
html,body{height:100%;width:960px;}
.container{background-color:#cccccc;width:960px;height:100%;margin:0 auto;}

</style>

此情况下,container不居中,去掉html,body中的width:960px后居中

posted @ 2014-01-10 09:47  ITCHN  阅读(251)  评论(0编辑  收藏  举报