2016-12-29 76 views
3

我想把一些图像放到我的背景div中。 我预计这5个图像文件将在“.well”类的div中,但他们只是分散在该div中。所以,这是我的问题。
如何将这些图像文件稳定地放入.well div? 有我的代码,并导致如下:问:AngularJS,我怎样才能把图像放到我的背景div中?

<!doctype html> 
 
<html ng-app="exampleApp"> 
 
\t <head> 
 
\t \t <script src="angular.js"></script> 
 
\t \t <link href="bootstrap.css" rel="stylesheet"></link> 
 
\t \t <link href="bootstrap-theme.css" rel="stylesheet"></link> 
 
\t \t <script> 
 
\t \t \t angular.module("exampleApp", []) 
 
\t \t \t .controller("exampleCtrl", function($scope){ 
 
\t 
 
\t \t \t $scope.data = [ 
 
\t \t \t \t { movie:"Pandora", date:"2016-12-07", img:"pandora.gif" }, 
 
\t \t \t \t { movie:"Lalaland", date:"2016-12-07", img:"lalaland.gif" }, 
 
\t \t \t \t { movie:"Willyoubethere", date:"2016-12-14", img:"willYouBeThere.gif" }, 
 
\t \t \t \t { movie:"brother", date:"2016-11-23", img:"brother.gif" }, 
 
\t \t \t \t { movie:"Animal", date:"2016-11-16", img:"fantasticAnimalDictionary.gif" } 
 
\t \t \t ]; 
 
\t \t \t }); 
 
\t \t </script> 
 
\t </head> 
 
\t <body ng-controller="exampleCtrl"> 
 
\t \t <div class="container"> 
 
\t \t \t <div class="well"> 
 
\t \t \t \t <div class="col-md-2" ng-repeat="data in data"> 
 
\t \t \t \t \t <img ng-src={{data.img}} /> 
 
\t \t \t \t </div> 
 
\t \t \t </div> 
 
\t \t </div> 
 
\t </body> 
 
</html>

The result from my code

+1

我们可以看到“好”的class css吗? –

+0

我们可以帮助,如果你证明了井类的好处 –

回答

1

添加rowwell。这样

<div class="well row"> 
    <div class="col-md-2" ng-repeat="data in data"> 
     <img ng-src={{data.img}} /> 
    </div> 
</div> 

row类是columns.The行的容器提供了列有地方住,有理想,加起来12列它还作为一个包装,因为所有的列左浮动,其他行当漂浮物变得怪异时不会有重叠。

+0

真棒。它工作得很好。 'row'函数在这种情况下做了什么? – moon

+0

并且非常感谢。 – moon

+0

我更新了答案。请检查。 – Ahmar

相关问题