c# - 图片在 Chrome 上工作正常,但在 IE 上不行

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

我的页面右侧有两张图片并排放置。它在 Chrome 中完美运行并显示正确,但在 Internet Edge 中图片非常大。我错过了什么?

代码如下:

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>";

最佳答案

尝试为两张图片添加width: 50%

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

关于c# - 图片在 Chrome 上工作正常,但在 IE 上不行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45794286/

相关文章:

c# - 如何使用 ToolTipService.Duration 使 WPF ToolTip 显示得更快?

c# - 返回单个参数作为多映射查询的一部分

c# - iOS 模拟器以空蓝屏启动

css - 如何使用自定义 css 类格式化 mat-field?

css - 导航背景颜色在手机上发生变化

google-chrome - 为什么 google chrome 的地址栏中不显示 favicon 文件?

c# - C# 标准库中的 B 树类?

javascript - 在 ipad chrome 上触发的鼠标滚轮事件

javascript - 当多个 Canvas 同时运行时,Chrome CPU 使用率过高

html - CSS first-child 和 last-child 在同一个元素上使用时不起作用