我需要删除没有图片的帖子和下面的帖子之间的空间,这里是图片,所以如果帖子没有图片,那么帖子下面不应该有空间:
代码如下:
<div class="container">
<div class="row">
<div class="col-sm-4 col-md-4">
<img src="http://placehold.it/460x250/e67e22/ffffff&text=HTML5" class="img-responsive" />
<div class="content">
<h4>NASLOV</h4>
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem
Ipsum has been the industry's standard dummy text ever since the 1500s, when an
unknown printer took a galley of type and scrambled it to make a type specimen book.
</p>
</div>
</div>
<div class="col-sm-4 col-md-4">
<img src="http://placehold.it/460x250/e67e22/ffffff&text=HTML5" class="img-responsive" />
<div class="content">
<h4>NASLOV</h4>
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem
Ipsum has been the industry's standard dummy text ever since the 1500s, when an
unknown printer took a galley of type and scrambled it to make a type specimen book.
</p>
</div>
</div>
<div class="col-sm-4 col-md-4">
<img src="http://placehold.it/460x250/e67e22/ffffff&text=HTML5" class="img-responsive" />
<div class="content">
<h4>NASLOV</h4>
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem
Ipsum has been the industry's standard dummy text ever since the 1500s, when an
unknown printer took a galley of type and scrambled it to make a type specimen book.
</p>
</div>
</div>
<div class="col-sm-4 col-md-4">
<img src="http://placehold.it/460x250/e67e22/ffffff&text=HTML5" class="img-responsive" />
<div class="content">
<h4>NASLOV</h4>
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem
Ipsum has been the industry's standard dummy text ever since the 1500s, when an
unknown printer took a galley of type and scrambled it to make a type specimen book.
</p>
</div>
</div>
<div class="col-sm-4 col-md-4">
<img src="http://placehold.it/460x250/e67e22/ffffff&text=HTML5" class="img-responsive" />
<div class="content">
<h4>NASLOV</h4>
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem
Ipsum has been the industry's standard dummy text ever since the 1500s, when an
unknown printer took a galley of type and scrambled it to make a type specimen book.
</p>
</div>
</div>
<div class="col-sm-4 col-md-4">
<img src="http://placehold.it/460x250/e67e22/ffffff&text=HTML5" class="img-responsive" />
<div class="content">
<h4>NASLOV</h4>
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem
Ipsum has been the industry's standard dummy text ever since the 1500s, when an
unknown printer took a galley of type and scrambled it to make a type specimen book.
</p>
</div>
</div>
<div class="col-sm-4 col-md-4">
<img src="http://placehold.it/460x250/e67e22/ffffff&text=HTML5" class="img-responsive" />
<div class="content">
<h4>NASLOV</h4>
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem
Ipsum has been the industry's standard dummy text ever since the 1500s, when an
unknown printer took a galley of type and scrambled it to make a type specimen book.
</p>
</div>
</div>
</div>
</div>
现场直播:http://www.bootply.com/sfmRGTiKS4 任何想法? :)
最佳答案
要获得您想要的内容,您的模板不必按行排列,而只需按列排列,这样每列中的元素将在彼此的下方放置,而不受行强加的空间限制。为此删除外部 <div class="row">
关于javascript - 删除帖子之间的空间 [bootstrap],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30607762/