图像工作正常我Chrome但不是IE

时间:2017-08-21 10:00:02

标签: c# css google-chrome internet-explorer responsive

我的页面右侧有两张图片。它在Chrome中完美运行并显示正确,但在互联网边缘,图片是巨大的。我错过了什么?

代码如下:

text = "<div><center><table style=\"width:100%;\">" +
        "<tbody><tr>" +
        "<td align=\"left\">" +
        "<a href=\"http://www." + test + "/m.aspx\"><center><img style=\"display: block; height: auto;max-width: 95%;margin: 0 auto;\" src=\"/images/" + entryM.Image + "\"></center></a>" +
        "</td>" +
        "<td align=\"right\">" +
        "<a href=\"http://www." + test + "/test/" + entryR.url + "\" target=\"_blank\"><center><img style=\"display: block; height: auto;max-width: 95%;margin: 0 auto;\" src=\"/images/" + 
entryR.Image + "\"></center></a>" +
        "</td> " +
        "</tr>" +
        "<tr>" +
        "<td style=\"text-align:center;\">test</td>" +
        "<td style=\"text-align:center;\">test</td>" +
        "</tr>" +
        "</tbody></table>" +
        "<table style=\"width:100%; margin-bottom: 30px;\">" +
        "<tbody><tr>" +
        "<td style=\"text-align:center;\">" +
        "<a href=\"http://www." + test + "/m.aspx\"><u>test</u></a>" +
        "</td>" +
        "</tr>" +
        "</tbody></table>" +
        "</center></div>";

2 个答案:

答案 0 :(得分:0)

尝试将width: 50%添加到两个图片

<img style=\"display: block; height: auto; width: 50%; max-width: 95%;margin: 0 auto;\" src=\"/images/" + entryM.Image + "\">

答案 1 :(得分:0)

 @supports (-ms-ime-align:auto) {
  /* edge*/
  .img{
    max-height: 92px;//img height
  }
 }

  @media all and (-ms-high-contrast:none){
    /* ie*/
    .img{
      height: 43px;//img height
    }
  }