Flex wrap无法在Safari和Chrome上运行-该文档似乎有据可查,但我所阅读的修复程序均无法解决我的情况。
在iOS Safari和Chrome上,这些行不会自动换行,而是会移出容器。我曾尝试通过Autoprefixer运行它,但仍然没有乐趣。
这是一个简化的测试用例:https://codepen.io/jciw/pen/yxPebP
* {
box-sizing: border-box;
}
body {
background-color: #ccc;
}
.container {
width: 1000px;
margin: 0 auto;
background-color: white;
}
.row {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-ms-flex-direction: row;
flex-direction: row;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
margin-left: -25px;
margin-right: -25px;
}
.column-one-third {
width: 33.333%;
padding-left: 25px;
padding-right: 25px;
}
<div class="container">
<div class="row">
<div class="column-one-third">
<h1>Hello</h1>
</div>
<div class="column-one-third">
<h1>Hello</h1>
</div>
<div class="column-one-third">
<h1>Hello</h1>
</div>
<div class="column-one-third">
<h1>Hello</h1>
</div>
<div class="column-one-third">
<h1>Hello</h1>
</div>
<div class="column-one-third">
<h1>Hello</h1>
</div>
<div class="column-one-third">
<h1>Hello</h1>
</div>
<div class="column-one-third">
<h1>Hello</h1>
</div>
<div class="column-one-third">
<h1>Hello</h1>
</div>
<div class="column-one-third">
<h1>Hello</h1>
</div>
<div class="column-one-third">
<h1>Hello</h1>
</div>
<div class="column-one-third">
<h1>Hello</h1>
</div>
<div class="column-one-third">
<h1>Hello</h1>
</div>
<div class="column-one-third">
<h1>Hello</h1>
</div>
</div>
</div>