css - 嵌套的 flexbox 在 IE10 和 11 上添加空白空间

标签 css internet-explorer-11 flexbox internet-explorer-10

我正在使用 flexbox 进行布局。我的限制是图像必须位于中间。

我做了一个重现问题的最小标记:http://codepen.io/anon/pen/xwNomN

它在除 IE 10 和 11 之外的所有浏览器中都运行良好,其中(如 CodePen 所示)在图像的顶部和底部添加了大量空白区域。

.collection__list {
  display: flex;
  flex-wrap: wrap;
}

.product-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-item__figure {
  position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 0 auto;
}

.product-item__figure > a {
  display: flex;
    position: relative;
    flex: 1;
}

.product-item__image-wrapper {
    position: relative;
    width: 100%;
}

.product-item__image {
      display: block;
    margin: 0 auto;
  max-width: 100%;
}

我已经尝试了很多修复方法,使用了 flex-shrinkflex-grow...但是在失去了一整天之后,我很乐意知道我做错了什么。

谢谢

最佳答案

哦……偶然发现的。将 overflow: hidden 添加到 product-item__figure 就成功了....

关于css - 嵌套的 flexbox 在 IE10 和 11 上添加空白空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33915243/

相关文章:

javascript - html网页在不同浏览器中的变化

html - IE11 是否完全支持 css 3d 转换 (preserve-3d)

javascript - 统计 IE 中打开的选项卡数量

html - flex 基础示例 : content

css - 在创建模态后添加内容时,Bootstrap 3.3 模态背景会中断

css - 为什么填充在 Chrome 中不起作用

javascript - addEventListener IE11 错误

html - 显示 flex,使图像与另一列高度相同

html - 嵌套 flex 盒高度与最大高度

javascript - 为什么我的页面在隐藏一些元素后会刷新?