html - Bootstrap 列未正确对齐,AngularJS 循环

标签 html css angularjs twitter-bootstrap

在做一些研究时,我发现我遇到了与此处完全相同的问题:Bootstrap columns not aligning correctly .

除了我不能使用相同的解决方案,因为列是通过 ng-repeat 循环添加的,我无法预测它们的高度或会有多少。

当一个比其他的高一点时,它们不能正确堆叠,您建议如何解决这个问题?

相关代码( Controller 只是填充产品数组):

<div class="col-sm-2 text-center" ng-repeat="product in products">
      <img class="img-responsive img-center" src="{{product.image}}" alt="">
      <h4>
          <a href="#/list/{{product.product_id}}">{{product.name}}</a>
      </h3>
      <p>Price: {{product.price}}€</p>
</div>

谢谢!

最佳答案

您可以使用像 Masonry 或 Isotope 这样的 jQuery 插件,这将使图像无论高度如何都适合。或者您可以像这个例子一样尝试 CSS 3 列宽:http://www.codeply.com/go/Ndk9jqofgR

关于html - Bootstrap 列未正确对齐,AngularJS 循环,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30969922/

相关文章:

html - 从 div 顶部旋转 3d()

javascript - HTML5视频时长

html - 仅展开一个表格单元格

angularjs - 单水疗中心的替代品

angularjs - AngularJS浏览器缓存问题

html - 适合显示静态 html 页面的 C++ 小部件

python - 无法使用 django 加载 css 文件

css - 字体加载不正确

html - HTML/CSS 中的滚动条格式

performance - 数据绑定(bind)对象的 Angular 性能限制 : Do I abandon AngularJS now?