DIV+CSS高手进。

来源:百度知道 编辑:UC知道 时间:2024/05/31 12:33:23
<style type="text/css">
<!--
body {

font-family: "宋体";
margin: 0px;

font-size: 12px;
}
#wer{height:30px;
width: 1200px;
background-color:#666666;

}
#wer_1{
height:30px;
width:200px;
background-color:#222222
text-align: right;
background-color: #FF0000;
}
#wer_2{
height:30px;
width:200px;
background-color:#00FF00;
text-align: center;

}
#tou {
height:1000px;
width: 960px;
background-color: #996600;
}

-->
</style>
</head>

<body>
<div id="wer">
<div id="wer_2"></div>
<div id="wer_1"></div>

</div>
<div id="tou"></div>
</body>
</h

在#wer_1和#wer_2下个加一个float:left;就行了
#wer_1{
float:left;
height:30px;
width:200px;
background-color:#222222
text-align: right;
background-color: #FF0000;
}

#wer_2{
float:left;
height:30px;
width:200px;
background-color:#00FF00;
text-align: center;

}

没时间看你代码,这个我编写过的,研究一下,很容易就学会的
<style type="text/css">
* { margin:0; padding:0;}
body { color:#fff;}
#mian { background:#000; width:760px; margin:0 auto;}
#left { width:100px; float:left; background:gray;}
#centr { width:500px; float:left; background:aqua;}
#right { width:160px; float:left; background:fuchsia;}
</style>
<div id="mian">
<div id="left"><ul><li>fff</li></ul></div>
<div id="centr">犯得上发生发生犯得上发生发生犯得上发生发生犯得上发生发生犯得上发生发生犯得上发生发生犯得上发生发生犯得上发生发生犯得上发生发生犯得上发生发生</div>
&