【发布时间】:2015-12-29 09:17:11
【问题描述】:
我试图让 justify-content: flex-end; 在 IE11 中为溢出隐藏的 DIV 内容工作,但没有成功。
在尝试了几种组合之后,我创建了一个在 Chrome 中工作但在 IE11 中不可用的最小 sn-p:
.token-container {
width: 200px;
white-space: nowrap;
overflow: hidden;
padding: 5px;
box-shadow: 1px 1px 2px 1px silver inset;
display: flex;
flex-direction: row;
justify-content: flex-end;
//align-content: flex-end;
}
.token {
display: inline-block;
border: 1px solid silver;
margin: 1px 3px 0 0;
border-radius: 4px;
height: 19px;
padding: 0 3px;
}
<div class="token-container">
<div class="token">
<span class="token-text">t-bone</span>
</div>
<div class="token"><span class="token-text">hamburger</span></div>
<div class="token"><span class="token-text">pancetta</span></div>
<div class="token"><span class="token-text">leberkäs</span></div>
<div class="token"><span class="token-text">bacon</span></div>
</div>
这是 CodePen 中相同的 sn-p:http://codepen.io/anon/pen/bVgOYJ
我希望“培根”项与盒子的右端对齐;相反,“t-bone”向左对齐。
请指出任何错误,也许是我对 Internet Explorer 的期望。
更新:添加了我自己的替代解决方案
利用response to another SO question,我能够做到——无需使用 flexbox。
http://codepen.io/anon/pen/ZbeQmW
所以,谢谢@AaronSieb,我猜。
【问题讨论】:
标签: html css flexbox internet-explorer-11