.3{ background-color: #999;height:600px auto;width: 760px;}
.1,.2{ float:left; }
.1{width:211px; height:123px; background:#036; }
.2{width:324px;background:#0ff; height: 210px;}
我上面的CSS不能同一行??
class不能使用纯数字,你这里用了1、2、3这显然是错误的;
height:600px auto;属性值错误的。高度要么600px,要么auto;没有连个值一起用的用法;
.1,.2同时声明多个class,逗号后面要加空格;
background-color: #999;采用通用写法,既然后面都用了background前面为什么要用background-color: #999;呢;
我给你改了一下你的代码:如下css:
.div3{ background:#999;height:600px;width: 760px;}.div1, .div2{ float:left; }
.div1{width:211px; height:123px; background:#036; }
.div2{width:324px;background:#0ff; height: 210px;}
html:
<div class="div1">div1</div>
<div class="div2">div2</div>
</div>
温馨提示:答案为网友推荐,仅供参考