这是我的例子:http: //jsfiddle.net/rtCP3/62/
我有 3 个(或更多!) div 我想在一个容器中平均分配空间。当使用带有 ng-repeat 的角度时,样式不会被拾取。当我对完全相同的元素进行硬编码时,它工作得很好。
角度输出:
<div class="container ng-scope" ng-controller="ParentCtrl">
<!-- ngRepeat: item in list -->
<div class="box ng-scope ng-binding" data-ng-repeat="item in list">item1</div>
<div class="box ng-scope ng-binding" data-ng-repeat="item in list">item2</div>
<div class="box ng-scope ng-binding" data-ng-repeat="item in list">item3</div>
<div class="box ng-scope ng-binding" data-ng-repeat="item in list">item4</div>
<span class="stretch"></span>
</div>
硬编码:
<div class="container">
<div class="box">Item 1</div>
<div class="box">Item 2</div>
<div class="box">Item 3</div>
<div class="box">Item 4</div>
<span class="stretch"></span>
</div>
我基于这个stackoverflow问题:流体宽度与等距DIV