IE没有在图像周围包装文本

时间:2008-12-23 05:10:24

标签: html internet-explorer

我有一个包含此HTML的页面:

<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没有将文本包裹在图像周围,即使它是左对齐的。有什么想法吗?

2 个答案:

答案 0 :(得分:7)

使用:

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

而不是对齐。 align属性为deprecated

答案 1 :(得分:2)

首先,不推荐使用“align”。你会想在这里使用CSS float属性。

<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了!