<style type="text/css">
div{
border:2px red solid;
width:200px;
height:400px;
#div1{float:left;}
#div2{float:right;}
}
</style>
</head>
<body>
<div id="div1">栏目1</div>
<div id="div2">栏目2</div>
<style type="text/css"> div{ border:2px red solid; width:200px; height:400px; } #div1{float:left;} #div2{float:right;} </style>
应该这样,怎么能嵌套着写呢
div{
border:2px red solid;
width:200px;
height:400px;
}
#div1{float:left;}
#div2{float:right;}
这样才是对的
div{ border:2px red solid; width:200px; height:400px; } #div1{float:left;} #div2{float:right;}
id选择器要拿出来