2008-12-23 64 views
1

我有一個頁面,這個HTML:IE圖像周圍沒有環繞文字

<p> 
    <img src="images/ih01.jpg" width="80" height="110" align="left" /> 
    This course overs basic human anatomy and physiology, including the major 
    body systems and their functions. When you have completed this course you 
    will be able to identify major body components and their core physiological 
    functions. 
</p> 

,這是它如何顯示在Firefox 3,Chrome瀏覽器1.0和IE7:(點擊查看原圖)

http://fisher.spadgos.com/stuff/ie-align-fail.png

你可以看到,即使它左對齊,IE瀏覽器並沒有將圖像包裹在圖像周圍。有任何想法嗎?

回答

7

用途:

<img src="images/ih01.jpg" style="float: left; height: 110px; width: 80px; " > 

,而不是對齊。 align屬性是deprecated

+0

男人,我從來不知道IE7停止支持對齊。乾杯。 – nickf 2008-12-23 05:19:03

+0

你打了我2秒。 – Triptych 2008-12-23 05:19:33

2

首先,「align」已棄用。你會想在這裏使用CSS浮點屬性。

<p> 
    <img src="images/ih01.jpg" style="float:left;height:110px;width:80px" />  
    This course overs basic human anatomy and physiology, including the major 
    body systems and their functions. When you have completed this course you 
    will be able to identify major body components and their core physiological 
    functions. 
</p> 

是時候對learn about floats進行「超時」了!