将div放在一起

时间:2017-02-17 17:40:21

标签: angularjs twitter-bootstrap-3

如何更改以下代码:

<div class="col-lg-8" ng-repeat="contact in [{name:'Jim'},{name:'Joe'},{name:'Dan'}]">
        <div class="col-lg-3">   
            <div>{{contact.name}}</div>
        </div>    
    </div> 

关于 让名字彼此相邻 而不是垂直,因为现在的情况如此?

1 个答案:

答案 0 :(得分:3)

请注意,您当前的html代码将重复<div class="col-lg-8">三次。您可能希望将其更改为以下内容:

<div class="col-lg-9">
    <div class="row">
        <div class="col-lg-4" ng-repeat="contact in [{name:'Jim'},{name:'Joe'},{name:'Dan'}]">
            <div>{{contact.name}}</div>
        </div>
    </div>
</div>

这将生成三个<div class="col-lg-4">以适合<div class="col-lg-9">