简体   繁体   English

img标签在firefox中正确,但在IE中它在屏幕底部显示图像

[英]img tag proper in firefox but in IE it is showing the image at the bottom of the screen

Hi i have the following code in my html. 嗨,我的HTML中包含以下代码。

<html>
    <tr>
    <td>
       some code here...
    </td>

    <td align="left" valign="top" width="35%">
        <img    src="http://ocs.landsend.com/lebowebcontent/images/global/marketing/TrueValue_SHIP_IMG.jpg" onerror='this.src="http://ocs.landsend.com/lebowebcontent/images/global/marketing/Stand_Ship_UPS_or_USPS.jpg";this.onerror=""' />
    </td> 

    </tr>
</html>

the image have to be displayed in the second column at the top of the screen but it is diplaying the at the bottom in IE.. but it is working fine in firefox and chrome. 该图像必须显示在屏幕顶部的第二列中,但在IE中却不显示在底部。但是在Firefox和chrome中它可以正常工作。

Please help.. 请帮忙..

You are missing the doctype and IE is less permissive. 您缺少文档类型,而IE的允许性较低。 Put this at the beginning of the html code: 将其放在html代码的开头:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM