[英]Bootstrap grid empty space
While making a frontpage for my website, I stumbled across an annoying css problem. 在为我的网站制作首页时,我偶然发现了一个烦人的CSS问题。 Look at the picture below:
看下面的图片:
Like shown in the picture, I want to list my items without the empty space. 就像图片中所示,我要列出我的物品,不要留有空白。 However, my attempts so far are unsuccessfull...
但是,到目前为止,我的尝试都没有成功。
Here is my code: 这是我的代码:
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-9">
<div class="row">
<!-- gets repeated for all items in array -->
<div class="col-md-6 col-xs-12" ng-repeat="flong in flongs">
<a href="/flong/id">
<div class="panel panel-default">
<div class="panel-body">
<img class="img-responsive center-block" src="http://placehold.it/350x175">
<p class="text-center"><b>Titel</b></p>
</div>
</div>
</a>
</div>
<!-- end loop -->
</div>
</div>
<div class="col-xs-12 col-md-3">
<div>
<!-- gets repeated for all items in array -->
<div class="row" ng-repeat="flong in flongs | limitTo: 5">
<div class="col-xs-12">
<a href="/flong/id">
<div class="panel panel-default">
<div class="panel-body">
<img class="img-responsive center-block" src="http://placehold.it/350x175">
<p class="text-center"><b>Titel</b></p>
</div>
</div>
</a>
</div>
</div>
<!-- end loop -->
</div>
</div>
</div>
</div>
anyone any idea how to fix this? 任何人有任何想法如何解决这个问题? After messing with it for over 4 hours, I'm pretty tired with this shit ;P
弄乱了四个多小时后,我对这个狗屎感到非常疲倦; P
On 8Flongs is an live example of the problem. 在8Flongs上是一个生动的例子。
Thanks in advance! 提前致谢! Nick van der Meij
尼克·范德·迈伊
After struggling with it for a few more hours i finally figured it out. 经过几个小时的努力,我终于弄明白了。 Its not the most CPU friendly way, but here it is:
它不是最友好的CPU方式,但这里是:
<div ng-hide="isLoading()">
<div class="col-md-6">
<div ng-repeat="flong in flongs">
<a href="/flong/{{flong.id}}" class="no-text-decorations" target="_blank" ng-show="$even" ng-mouseover="flong.showBody = true" ng-mouseout="flong.showBody = false">
<div class="panel panel-default">
<div class="panel-body">
<img class="img-responsive center-block" src="http://placehold.it/350x175">
<p class="text-center"><b>title</b></p>
<p class="text-center" style="color:white;" ng-show="flong.showBody">body</p>
</div>
</div>
</a>
</div>
</div>
<div class="col-md-6">
<div ng-repeat="flong in flongs">
<a href="/flong/{{flong.id}}" class="no-text-decorations" target="_blank" ng-show="$odd" ng-mouseover="flong.showBody = true" ng-mouseout="flong.showBody = false">
<div class="panel panel-default">
<div class="panel-body">
<img class="img-responsive center-block" src="http://placehold.it/350x175">
<p class="text-center"><b>title</b></p>
<p class="text-center" style="color:white;" ng-show="flong.showBody">body test</p>
</div>
</div>
</a>
</div>
</div>
</div>
Anyway, thanks for all the help! 无论如何,感谢您的所有帮助!
I might be too late to solve the problem for BattleOn but I would suggest using salvattore library. 我可能无法解决BattleOn的问题,但我建议使用salvattore库。 It creates a pinterest like structure with fluid elements.
它创建了一个类似于pinterest的带有流体元素的结构。
Site's here - http://salvattore.com/ 网站在这里-http: //salvattore.com/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.