【发布时间】:2017-03-22 07:37:53
【问题描述】:
据我所知,如果使用 IE10 / IE11,我应该能够使用标准化的弹性术语。
我有一个容器 div 和 2 个子 div。
2 个子 div 不大于 400px,因此应该始终有足够的空间放置 justify-content: space-between。
我希望第一个孩子一直在顶部,第二个孩子一直在底部。
这在 Chrome 和 Firefox 中有效,但在 IE 中无效,我不知道为什么。
欢迎任何 cmets 和反馈。
<div style="display: flex; flex-direction: column; justify-content: space-between; min-height: 400px; background-color: lightyellow;">
<div style="background-color: red;">
<h2>Title (variable height)</h2>
<p>Summary (variable height)</p>
</div>
<div style="background-color: orange;">
<img src="http://avatarbox.net/avatars/img32/tv_test_card_avatar_picture_61484.jpg" />
</div>
</div>
【问题讨论】:
-
我为容器添加了背景颜色。 ( 黄色的 )。可以在jsFiddle上看到容器在IE中是400px。
-
正如@GCyrillus 所说,
min-height在 IE 中使用 flex 和flex-direction: column无法正常工作,请改用height
标签: html css internet-explorer flexbox