2014-09-26 60 views
0

我有在我的网站一侧显示的横幅。 Firefox和I.E.把它们拉起来就好了,但是我没有得到它们。如果我检查元素,我可以看到它的内部图像的网址在Chrome中,并且在它拥有图像的资源中显示,但它只是不显示。Chrome VS Firefox img显示兼容性

if (drBanner.Length > 0) 
{ 
    for (int iRowIndex = 0; iRowIndex < drBanner.Length; iRowIndex++) 
    { 
    if (!CheckImageExist(drBanner[iRowIndex]["imgurl"].ToString())) 
     continue; 
    bannerValues += "{img class='right-banner' src='" + drBanner[iRowIndex]["imgurl"] + 
        "' onclick=MoveWindow('" + drBanner[iRowIndex]["imgnavurl"] + "') alt='" + 
        drBanner[iRowIndex]["imgalttxt"] + "'} $!$! " + 
        (drBanner[iRowIndex]["ovrimgimp"].ToString() == "0" 
         ? "1" 
         : drBanner[iRowIndex]["ovrimgimp"].ToString()) + "!~!~"; 
    } 
} 

的bannerValues结果作为随后

{IMG类= '右横幅' SRC = '.. /横幅/ oms_contactussidebar_oms_contactussidebar.jpg' 的onclick =的MoveWindow( '')ALT = ''} $!$! 1!〜!〜

正确的旗帜类也是为随后

img { 
    max-width:100%; 
    width:auto\9; 
    height:auto; 
    vertical-align:middle; 
    border:0; 
    -ms-interpolation-mode:bicubic; 
} 

有什么想法? 编辑1: 这是在浏览器中出现在HTML和FF中的HTML。

<div style="height: 620px; width: 160px;" id="divBanner"> 
<img img="" class="right-banner" src="../Banners/oms_orderingsidebar_oms_orderingsidebar_oms_orderingsidebar.jpg" onclick="MoveWindow('')" alt=""> 
</div> 

编辑2:

When I inspect the element in Chrome 0x0 maybe that could be it but I don't see what's setting it

+0

-ms-interpolation-mode是一个IE过时的语法 – kiwixz 2014-09-26 21:11:37

+0

即使完全删除,我仍然不会看到它在Chrome vs Firefox和IE浏览器。 另外,如果我检查页面,我可以看到-ms-interpolation-mode已成功删除。 版本37.0.2062.124 m这是我使用的chrome版本,如果有帮助的话(应该是最新的版本) – NitroFrost 2014-09-26 21:20:14

+0

为什么'width:auto \ 9'?我找不到任何东西。 – kiwixz 2014-09-26 21:22:34

回答

0

你 “图像宽度” 被设定○ “宽度:汽车\ 9章;”尝试使用“width:auto;” (没有\ 9)。其他问题:“vertical-align”仅适用于“display:table-cell”元素,而不适用于“display:inline”元素(img's)。

+0

不幸的是,这并没有解决问题。我在检查中确信这些元素不再出现。 FF,IE(好)Chrome(坏) – NitroFrost 2014-09-26 23:29:42