.top{width:100%;background:#ccc; height:100px;}
.main{width:100%;height:100%;background:#c66; }
.left{width:200px;height:300px;background:#333;}
.right{width:100%;height:300px;background:#666;position:absolute;left:210px;}
.foot{width:100%;background:#bce; height:50px;clear:both;}
.main{width:100%;height:100%;background:#c66; }
.left{width:200px;height:300px;background:#333;}
.right{width:100%;height:300px;background:#666;position:absolute;left:210px;}
.foot{width:100%;background:#bce; height:50px;clear:both;}
.head{width:100%; height:100px; background:#ccc; margin:0 auto;}最主要的是.head里的 margin:0 auto;别忘了敲,其他的宽度随便调都行,没有影响。
.top{height:50px;background:gray;}
.main{height:300px;background:red;position:relative;}
.left{width:200px;height:300px;background:blue;position:absolute;left:0px;top:0px;}
.right{height:300px;background:green;position:absolute;left:210px;right:0px;top:0px}
.foot{height:50px;background:#369;}
.main{height:300px;background:red;position:relative;}
.left{width:200px;height:300px;background:blue;position:absolute;left:0px;top:0px;}
.right{height:300px;background:green;position:absolute;left:210px;right:0px;top:0px}
.foot{height:50px;background:#369;}
.top{height:100px;background:red;}
.main{height:300px;background:blue;width:100%;position:relative;}
.left{width:200px;position:absolute;left:0;top:0;height:300px;background:pink;}
.right{background:green;height:300px;margin-left:210px;}
.foot{height:50px;background:grey;}
.main{height:300px;background:blue;width:100%;position:relative;}
.left{width:200px;position:absolute;left:0;top:0;height:300px;background:pink;}
.right{background:green;height:300px;margin-left:210px;}
.foot{height:50px;background:grey;}
.top{background:gray;width:100%;}
.main{background:red;position:relative;overflow:hidden;}
.left{background:blue; width:200px;float:left;height:500px;}
.right{background:green;width:100%;position:absolute;margin-left:210px;height:500px;}
.foot{background:orange;width:100%;}
对不对
.main{background:red;position:relative;overflow:hidden;}
.left{background:blue; width:200px;float:left;height:500px;}
.right{background:green;width:100%;position:absolute;margin-left:210px;height:500px;}
.foot{background:orange;width:100%;}
对不对
.top{width:100%; height:100px; background:#DDD;}
.main{width:100%; height:600px;background:red; margin:0 210px 0 0;}
.left{ width:200px; height:600px; background:blue; float:left;}
.right{ width:85%; height:600px; background:#9D9; float:right;}
.foot{width:100%; height:60px; background:#F50;}
.main{width:100%; height:600px;background:red; margin:0 210px 0 0;}
.left{ width:200px; height:600px; background:blue; float:left;}
.right{ width:85%; height:600px; background:#9D9; float:right;}
.foot{width:100%; height:60px; background:#F50;}
div{ text-align:left; line-height:50px ;}
.main{ width:960px; height:600px; margin:0 auto; background:white;}
.left{ width:260px; height:600px; background:#ccc; float:left; margin:0 20px;}/*左浮动样式*/
.right{ width:620px; height:600px; background:pink; float:right;margin:0 1px}/*右浮动样式*/
结果图ok,但改的有点多了把。
.main{ width:960px; height:600px; margin:0 auto; background:white;}
.left{ width:260px; height:600px; background:#ccc; float:left; margin:0 20px;}/*左浮动样式*/
.right{ width:620px; height:600px; background:pink; float:right;margin:0 1px}/*右浮动样式*/
结果图ok,但改的有点多了把。
.main{ width:960px; height:600px; margin:0 auto}
.left{ width:300px; height:600px; background:#ccc;float:left;}/*左浮动样式*/
.right{ width:660px; height:600px; background:#FCC;float:right;}
好逗啊!左右的宽度都等于父标签了,中间咋会有空隙呢????
.left{ width:300px; height:600px; background:#ccc;float:left;}/*左浮动样式*/
.right{ width:660px; height:600px; background:#FCC;float:right;}
好逗啊!左右的宽度都等于父标签了,中间咋会有空隙呢????