0
Hallo我有一个浮动Div问题,我不明白。CSS浮动Div与图像VS浮动Div与Div有背景图像
如果我用float:left属性和Image标签写一个div,两者都显示在一行中。 e.g
<div style="background-image:url(calendar_container_bg.gif);background-repeat:repeat-x;width:670px;height:253px;border:1px solid #8E9EAB">
<div style="height:36px">
<div style="float:left;color:#01389F;font:bold 14px Arial;padding-left:20px;line-height:36px;width:614px;">
Frühestes Anreisedatum.
</div>
<img src="calendar_close_btn.gif" style="padding-top:10px">
<div style="clear:left"></div>
</div>
</div>
但正如我repleace图像标签与具有相同的图像作为背景图像的DIV,则两个DIV将在2个不同的行上显示。我不想在第二个DIV中再次使用float:left。
“我不想使用float:在第二次DIV又离开了。”为什么不? – 2010-02-26 10:08:23