javascript - 删除帖子之间的空间 [bootstrap]

标签 javascript jquery html css twitter-bootstrap

我需要删除没有图片的帖子和下面的帖子之间的空间,这里是图片,所以如果帖子没有图片,那么帖子下面不应该有空间:

enter image description here

代码如下:

<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/

相关文章:

Javascript - 为什么这个函数值没有在每次调用时重置

javascript - 删除 Javascript 中的空子数组

javascript - 反转水平 AngularJS slider 自定义比例

javascript - 获取值最接近数字 X 的 JSON 数据

javascript - 在线性渐变的情况下隐藏重叠文本失败

javascript - 根据自定义切换开关的切换启用和禁用复选框

javascript - 电报信使彩色框,填充联系人姓名首字母

javascript - toLocaleDateString() 不返回 dd/mm/yyyy 格式

javascript - 无法从 jQuery on 事件调用函数

javascript - 关闭弹出窗口后自动刷新父窗口