【问题标题】:Auto-scaled image not shown correctly with IE 10IE 10 无法正确显示自动缩放的图像
【发布时间】:2014-10-16 19:19:48
【问题描述】:

首先:这不是我的代码,这就是为什么我不明白其中的大部分内容。

我有一个在 UL 列表旁边显示图像的网页。此图像的大小会根据浏览器中可用的可见宽度自动缩放。此 CSS/HTML 代码在 Chrome、Opera、Firefox 上运行良好,但在 IE 10 上失败了。只显示一条水平线,表示图像被缩放到一个像素高度。

这就是图片嵌入网页的方式:

<div id="eth_group">
 <div id="eth_list">
  <ul>
   <li>here is my list
  </ul>
 </div>
 <div id="eth_image">
  <img src="img/myimg.png" border=0 align="right" width="100%" height="auto"; />
 </div>
</div>

这是相关的 CSS 文件:

#eth_group{display:table;}
#eth_list{display:table-cell;float:left;width:65%}
#eth_image{float:left;width:35%;display:table-cell;}
/* --------- MEDIA !   800  --------------  */
@media only screen and (max-width: 800px){
#eth_group{display:inline;}
#eth_list{display:block;width:100%;}
#eth_image{width:80%;display:block;marigin:0 auto;}
}

任何人知道必须改变什么才能让图像在 IE 中也正确显示吗?

谢谢:-)

【问题讨论】:

  • 你的#eth_image CSS 中有一个错误——“marigin”而不是“margin”。
  • danmullen:谢谢,但这不是原因。还添加了“height:auto; 不能解决问题

标签: html css internet-explorer internet-explorer-10


【解决方案1】:

已解决,是由于

 height="auto";

在 IMG 标记中。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-10-12
    • 1970-01-01
    • 2017-05-20
    • 1970-01-01
    • 2018-01-23
    • 1970-01-01
    • 2017-06-29
    相关资源
    最近更新 更多