【发布时间】:2014-03-20 00:14:40
【问题描述】:
我正在使用 phonegap 开发和应用程序。我想使用 flexbox 在我的主应用程序区域中布局一些按钮。
有人可以解释为什么这个http://jsfiddle.net/apYLB/ 没有在最新的 chrome 中包装元素吗?
HTML:
<div class="flex-container">
<div class="flex-item">1</div>
<div class="flex-item">2</div>
<div class="flex-item">3</div>
<div class="flex-item">4</div>
<div class="flex-item">5</div>
<div class="flex-item">6</div>
</div>
CSS:
.flex-container {
display: -webkit-box;
display: flex;
flex-wrap: wrap;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
-webkit-flex-direction: row;
-webkit-flex-flow: row wrap;
flex-flow: row wrap;
-webkit-box-align: end;
-moz-box-align: end;
box-align: end;
-webkit-box-pack: center;
-moz-box-pack: center;
box-pack: center;
justify-content:space-around;
height:100%;
}
.flex-item {
margin:0 10px 25px 0;
width:86px;
border:1px solid #000;
}
.flex-item img {
max-height:80px;
}
它们被水平放置,只出现了 3 个半的盒子。
【问题讨论】:
-
这是一个方便的图表,用于匹配来自不同草稿的属性/值:gist.github.com/cimmanon/727c9d558b374d27c5b6