【问题标题】:Image size difference between chrome and internet explorer 11chrome和internet explorer 11的图片大小差异
【发布时间】:2018-08-09 02:46:33
【问题描述】:

我正在为图像添加一个简单的网站,但是 Internet Explorer 11 上的大小被计算得要小得多,并且图像之间会发生变化:

internet explorer image

但在 chrome 上可以正常工作

chrome image

这是图片的css:

.postImage {
  padding: 0 0 0 15px;  
  height: 50px;
  width: 50px;
  border-radius: 2px;
}

提前致谢!

【问题讨论】:

  • 可能与您发布的代码无关,而是包含帖子图像的另一个元素。您是否有机会使用divflex 属性?
  • 是的,其中一个父元素使用 display:flex
  • 尝试将min-height: 1px 添加到弹性项目中,看看是否能解决问题。您可能还想参考github.com/philipwalton/flexbugs/issues/75
  • 我尝试了这个线程中提到的所有方法,但仍然没有运气,但它很可能与这个错误有关。如果我弄明白了,我会告诉你的,非常感谢你指点我!
  • 没问题。如果你弄明白了,请绝对分享。帮助整个社区。​​span>

标签: html css wordpress


【解决方案1】:

所以,在对它进行了一些修改并从here 获得帮助之后,我让它跨浏览器工作。这似乎很奇怪,因为我设置了两次高度,但这是我对 IE11 的预期效果的唯一方法。

父类:

.postBox{
  height: 100px;
  width: 220px;
  margin-bottom:15px;
  display: flex;
  cursor :pointer;

  /* to fix IE11 */
    min-height:1px;
  padding: 10px 0 0 0px;
}

儿童图像类:

.postImage {
  padding: 0 0 0 15px;  
  border-radius: 2px;

/*   to fix IE11 not working */
  max-height:50px;
  max-width:50px;
  height: 50px;
}

【讨论】:

    猜你喜欢
    • 2018-03-27
    • 1970-01-01
    • 2015-01-27
    • 2017-05-19
    • 1970-01-01
    • 2015-04-20
    • 1970-01-01
    • 2014-02-18
    • 2016-05-23
    相关资源
    最近更新 更多