CSS求助---层浮动的问题

来源:百度知道 编辑:UC知道 时间:2024/06/15 01:53:44
我的大层宽度已定义,在里面插入4个小层,也都定义了,也给每个小层一个左浮动了,可问题出现了,1和2的顺序是想要的,可3跑到4的位置,而4被挤到了下面,请问各位路过的朋友们,麻烦你们给看看是问题出在哪里啊?谢谢了!
代码如下:
<div id="right4" class="left" style="background:url(../images/xiangmufu.jpg) no-repeat;height:31px;color:#FFFFFF;padding-left:12px;padding-top:6px;">
<h4>
<span style="font-size:14px;color:#FFFFFF;">蜂产品保健</span><a href="#" style="margin-left:360px;color:#60AB08;font-size:11px;">更多>></a>
</h4>

<div id="a" class="left" style="width:248px; border-right:#CCCCCC 1px dashed;border-bottom:#CCCCCC 1px dashed; background:#FF0000;">
1111111111
</div>

<div id="b" class="left" style="width:248px; background:#FFFF00;">
22222222222
</div>

<div id=

<html>
<head>
<style>
<!--
.left{float:left;}
-->
</style>
</head>
<body>
<div style="width:600px;">

<div class="left" style="width:248px; background:#F00;">
1111111111
</div>

<div class="left" style="width:248px;background:#FF0;">
2222222222
</div>

<div class="left" style="width:248px;background:#00F;">
3333333333
</div>

<div class="left" style="width:248px;background:#090;">
4444444444
</div>

</div>
</body>

在<head>标签中加上一句左浮动,
<head>
<style>
<!--
.left{float:left;}
-->
</style>
</head>
再把父级DIV(id="right4")的定义一个宽度:width:1006px;

首先要说