我想浮在下面的代碼片段(表格單元格)中留下的圖片。除了下面顯示的內容之外,沒有應用CSS - 我嘗試了所有我能想到的方法,但無濟於事。我正在FF中顯示頁面。浮動div包含一個嵌套的div中留下的圖片
<tr>
<td>
<div>
<div style="width:60%; float left;">
<div>
<div><h4 style="margin:0px 0px;">Hello</h4> <strong>World!</strong></div>
<div>Line 1</div>
<div>Line 2</div>
<div>Line 3</div>
</div>
<div>
<div>Line 4</div>
<div>Line 5</div>
</div>
<!-- no effect, so commented out
<div style="clear:both; height: 1px;"></div> -->
</div>
<!-- I want this next div floated right as instructed in the CSS - but it has no effect! :/ -->
<div style="width:35%; float right;">
<a href="<?php echo $row['page_link']; ?>"><img src="<?php echo $row['photo_link']; ?>" /></a>
</div>
<!-- no effect, so commented out
<div style="clear:both; height: 1px;"></div> -->
</div>
</td>
</tr>
我在做什麼錯了?
下一次使用css驗證器來檢查這種類型的錯誤。 – alonisser 2012-01-18 22:04:31