背景颜色为何会扩展到其它区域?
<form id= "form1 " runat= "server ">
<div>
<img id= "logo " src= "/Images/logo.jpg " alt= "logo " />
<img id= "xiaoxun " src= "/Images/xiaoxun.gif " alt= "校训 "/>
</div>
<div id= "IdTime "> <asp:Label ID= "Label1 " runat= "server " Text= "Label " </asp:Label> </div>
</form>
相关CSS如下:
#logo{ margin-left:3px; float:left;}
#xiaoxun{float:right;}
#IdTime
{
border-top: 2px inset;
border-bottom: 2px inset;
background-color: #33ccff;
border-right: 2px inset;
margin-left: 2px;
}
我想问的是:对IdTime设置的背景色为何会嵌入到两个图片之间的空隙中,按理不应该啊。请高手指教。谢谢!!!
我用XP+IE6
------解决方案--------------------在IdTime加上样式clear:both清除浮动