我显示 DIV
元素作为 inline-block的。有元素之间的一个奇怪的差距,其中一个 NG-重复
结束和下一个开始,通过图像所示:
I am having a problem with multiple ng-repeat
elements when showing div
elements as inline-block
. There is a strange gap between elements where one ng-repeat
ends and the next one starts, as illustrated by the image:
我创建了一个普拉克来演示此行为:
I have created a plunk to demonstrate this behavior:
这究竟是为什么以及如何删除的差距?
Why is this happening and how to remove the gap?
勾选此普拉克
有一个劈出现在换行内联元素之间移除空间。
There is a hack to remove space between inline elements that appears at line-break.
<div class="red" ng-controller="TestCtrl">
<div class="blue number" ng-repeat="number in array1 track by $index">{{number}}</div><!--
--><div class="green number" ng-repeat="number in array2 track by $index">{{number}}</div><!--
--><div class="teal number" ng-repeat="number in array3 track by $index">{{number}}</div>
</div>
您可以了解更多有关的其他黑客这里。
You could read more about other hacks here.