小提琴:http: //jsfiddle.net/hectooorr/dcwt3to2/
我有2个问题。无法对齐相邻的 2 个容器。无法获得一致的宽度。
第一个问题:当它们的宽度均为 50% 时,如何让 2 个容器彼此对齐?在我下面的场景中,我总是有两个容器,每个容器的宽度为 50%。当我这样做时,我的容器没有对齐。是否应该将这两个添加到他们自己的行中,并将 50% 添加到一个并弯曲到另一个?
<div layout="row" layout-margin layout-fill layout-wrap class="custom-chart-list">
<div flex="100" class="custom-container">container 1: 100% width - why does this width exceed width of containers 2 and 3?</div>
<div flex="50">container 2: 50% width</div>
<div flex="50">container 3: 50% width</div>
<div flex="100" class="custom-container">100% width</div>
<div flex="50">container 4: 50% width</div>
<div flex="50">container 5: 50% width - Why won't this stack next to container 4?</div>
第二个问题:为什么一个flex="100"的容器超过了2个容器的宽度,每个容器的宽度为50%?请参见下面的示例。第一行的 flex 为 100。第二个容器的 flex 为 50,第三个容器只有 'flex' 属性。