css - 当父项具有 flex-flow : column wrap; 时,元素在带有 Flexbox 的 IE11 中未水平居中

标签 css internet-explorer-11 flexbox

JSFiddle Link

.thing {
	background-color: tomato;
	max-width: 300px;
	padding: 30px;
	display: flex;
	margin: 0 auto;
	flex-flow: column wrap;
}

.not-centered {
	max-width: 150px;
	background-color: #fefefe;
	margin: 0 auto;
}
<div class="thing">
	<div class="not-centered">
		im not centeredi in ie11
	</div>
</div>

我认为它可以工作,因为如果设置了 max-widthmargin: 0 auto。但是正如你所看到的,它不是水平居中的,因为他的父 .thingflex-flow: column wrap

有什么想法可以在此设置中解决这个问题吗?

P.S. 适用于 Chrome/FF

最佳答案

.not-centered 包装在 div 中并显示 block 解决了 IE11 中的问题

关于css - 当父项具有 flex-flow : column wrap; 时,元素在带有 Flexbox 的 IE11 中未水平居中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31354137/

相关文章:

html - 如何在不换行的情况下将两个 div 放置在每个扩展到可用大小的旁边

html - 隐藏带有向右浮动的长文本

html - Microsoft 是否有 HTML5 服务器发送事件的等效项?

html - Flex 行包含 5 个 div,其中一个具有静态宽度,其他四个具有百分比

html - flex 方向 : column-reverse except the first element

html - margin :0 auto; is not working to put one div center of another div

IE10中涉及百分比宽高的HTML布局

javascript - IE 11 Script1002 Array.Filter(x => ...)(箭头函数)

canvas - 使用 OpenLayer3,Internet Explorer 11 不显示基于 svg 的图层

css - 在CSS Flexbox中,为什么没有“justify-items”和“justify-self”属性?