相关疑难解决方法(0)

IE11上的Flexbox:图像无缘无故延伸?

我在IE11上遇到了与flexbox有关的问题,虽然我知道有很多已知问题,但我还是找不到解决方案......

<div class="latest-posts">
    <article class="post-grid">
        <img src="http://lorempixel.com/image_output/cats-q-c-640-480-4.jpg" alt="" />
        <div class="article-content">
             <h2>THIS IS POST TITLE</h2>
             <p>BLAH</p>
        </div>
    </article>
</div>
Run Code Online (Sandbox Code Playgroud)

而CSS ......

img {
  max-width: 100%;
}

.latest-posts {
  margin: 30px auto;
}

article.post-grid {
  width: 375px;
  float: left;
  margin: 0 25px 100px 0;
  padding-bottom: 20px;
  background-color: #fff;
  border: 1px solid #f3f3f3;
  border-radius: 2px;
  font-size: 14px;
  line-height: 26px;
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  justify-content: flex-start;
  align-content: flex-start;
}
.article-content {
  padding: 20px 35px;
}
Run Code Online (Sandbox Code Playgroud)

图像在弹性容器内被拉伸.

在此输入图像描述

应用align-items: flex-start …

html css flexbox internet-explorer-11

57
推荐指数
2
解决办法
2万
查看次数

标签 统计

css ×1

flexbox ×1

html ×1

internet-explorer-11 ×1