【发布时间】:2017-11-30 14:03:58
【问题描述】:
在 Internet Explorer 11 中,https://www.superiorit.com.au 右上角的“s 控件”图标显示为 height: 94px;
在img 标签中指定:
<img src="https://www.superiorit.com.au/wp-content/uploads/2017/11/new_connect_logo_web_normal.png" width="375" height="94" srcset="https://www.superiorit.com.au/wp-content/uploads/2017/11/new_connect_logo_web_normal.png 375w, https://www.superiorit.com.au/wp-content/uploads/2017/11/new_connect_logo_web_normal-300x75.png 300w" sizes="(max-width: 375px) 100vw, 375px" class="so-widget-image">
但是 CSS height: auto; 在:
.so-widget-sow-image-default-eef982a7180b .sow-image-container .so-widget-image {
display: inline-block;
max-width: 100%;
width: inherit;
height: auto;
}
不被 IE11 尊重。 Chrome 尊重这个 CSS 并将 img 的高度降低到 25px 高:
如何让 IE11 显示 25px 高的图像?
【问题讨论】:
-
实际上你的 CSS 工作正常。因为如果我将宽度限制设置为直接父级或父级的父级,那么它将宽度设置为预期大小。问题出在其他地方。