css边距自动调整,CSS中心边距:0自动;(CSS centering margin:0 auto; issue)

Sorry if this was asked before but I read and did not see my mistake.I try to center the #wrapper with margin:0 auto; but nothing happens...the width is set also.

This is the CSS: I want the hole page to be centerd

@charset "utf-8";

body {

margin-left:0px;

margin-top:0px;

margin-right:0px;

margin-bottom:0px;

padding:0;

background-color:#000000;

text-align:center

}

#wrapper {

width: 901px;

***margin: 0 auto;***

}

#header {

background-image: url(images/banner.jpg);

background-repeat: no-repeat;

float: left;

height: 233px;

width: 901px;

}

#menu {

font-family: Arial, Helvetica, sans-serif;

background-image: url(images/menu.gif);

background-repeat: no-repeat;

text-align: center;

word-spacing: 70px;

padding-top: 17px;

float: left;

height: 33px;

width: 901px;

}

#main {

float:left;

height:auto;

width:901px;

}

#leftcol {

float:left;

height:auto;

width:300px;

padding-top:5px;

padding-right:0px;

padding-bottom:0px;

padding-left:30px;

}

#rightcol {

float:right;

height:auto;

width:500px;

padding-right:35px;

margin-right:0px;

}

#footer {

font-family:Arial, Helvetica, sans-serif;

font-size:x-small;

float:left;

height:250px;

width:900px;

color:#666666;

clear:both

}

Also the html:

this is the basic html file

Untitled Document
Content for id "wrapper" Goes Here
Content for id "main" Goes Here
Content for id "rightcol" Goes Here
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值