我需要删除没有图像的帖子和下面的帖子之间的空间,这是图像,因此,如果帖子没有图像,则该帖子下面的空间应该没有:



这是代码:

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

10-04 22:10
查看更多