【发布时间】:2018-01-24 11:08:50
【问题描述】:
我的 IE10 和 flexbox 有问题。目前我使用如下sn-p之类的代码。
col 2 的内容具有可变长度(包含多个小元素),它应该具有所需的宽度。我想在它们之间有一条线。为此我添加了一个伪元素,通过order将其放在正确的位置,宽度为100%。
Chrome、Firefox 等可以渲染这个例子,但是如果我用 IE10 运行它,伪元素会消失,第二行的内容会自己移动到第一行。
IE10不可以和flexbox一起渲染伪元素吗?你知道强制中断的“黑客”吗?
/* Container */
.container {
display: flex;
flex-direction: row;
flex-wrap: wrap;
width: 200px;
}
.container:after {
background-color: #000;
content: '';
height: 2px;
margin: 5px 0;
order: 3;
width: 100%;
}
/* Child */
.child {
width: 100px;
border: 1px solid red;
box-sizing: border-box;
height: 50px;
line-height: 50px;
text-align: center;
}
/* Positioning of the childs */
.c1 {
order: 1
}
.c2 {
order: 2
}
.c3 {
order: 4
}
.c4 {
order: 5
}
<div class="container">
<div class="child c1">row 1 col 1</div>
<div class="child c2">row 1 col 2</div>
<div class="child c3">row 2 col 1</div>
<div class="child c4">row 2 col 2</div>
</div>
【问题讨论】:
-
IE10 需要不同的语法。看看这里stackoverflow.com/questions/18711282/…
标签: css internet-explorer flexbox internet-explorer-10 pseudo-element