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