0

Всем привет. Есть блок с отзывами - проблема возникает тогда, когда отзывы имеют разное по размерам содержание и после блоков остается слишком много белого пространства - как исправить код так, чтобы блоки занимали свободное пространство аля масонри? картинка как пояснение отзывы Код

/* #Testimonials
================================================== */

.qvs-testimonial {
  margin-bottom: 20px;
}
.qvs-testimonial-quote {
  background: #f1f1f1;
  border-radius: 3px;
  margin-bottom: 30px;
  padding: 20px;
  position: relative;
  box-sizing: border-box;
}
.qvs-testimonial-quote:after {
  content: "";
  display: block;
  width: 0px;
  height: 0px;
  border: 20px solid transparent;
  border-left-color: #f1f1f1;
  position: absolute;
  bottom: -20px;
  left: 40px;
}
.qvs-testimonial-quote p {
  margin: 0;
}
/* testimonial author */

.qvs-testimonial-author-info {
  float: left;
  margin-top: 15px;
  width: 70%;
}
.qvs-testimonial-author-img img {
  width: 70px;
  height: 70px;
  -webkit-border-radius: 36px;
  -moz-border-radius: 36px;
  border-radius: 36px;
}
.qvs-testimonial-author-name {
  color: #444444;
  font-size: 1.2em;
  font-weight: bold;
  display: block;
}
<!-- *********************
			TESTIMONIALS
		********************** -->
<!-- TESTIMONIALS -->
<div class="qvs-testimonial box-4 wow bounceIn" data-wow-delay="0.7s">
  <div class="qvs-testimonial-quote">
    <p>Lorem ipsum ex vix illud nonummy, novum tation et his. At vix scriptaset patrioque scribentur, at pro fugit erts verterem molestiae, sed et vivendo ali Lorem ipsum ex vix illud nonummy, novum tation et his</p>
  </div>
  <div class="qvs-testimonial-author media">
    <div class="qvs-testimonial-author-img cl">
      <img src="/wp-content/uploads/2015/04/review-1.jpg" alt="">
    </div>
    <div class="qvs-testimonial-author-info bd">
      <span class="qvs-testimonial-author-name">John Doe.</span>
      <span>Smashing magazine</span>
    </div>
  </div>
</div>
<div class="qvs-testimonial box-4  wow bounceIn" data-wow-delay="1s">
  <div class="qvs-testimonial-quote">
    <p>
      Lorem ipsum ex vix illud nonummy, novum tation et his. At vix scriptaset patrioque scribentur, at pro fugit erts verterem molestiae, sed et vivendo ali Lorem ipsum ex vix illud nonummy, novum tation et his
    </p>
  </div>
  <div class="qvs-testimonial-author media" data-wow-delay="1.3s">
    <div class="qvs-testimonial-author-img cl">
      <img src="/wp-content/uploads/2015/04/review-2.jpg" alt="">
    </div>
    <div class="qvs-testimonial-author-info bd">
      <span class="qvs-testimonial-author-name">John Doe.</span>
      <span>Smashing magazine</span>
    </div>
  </div>
</div>
<div class="qvs-testimonial box-4 wow bounceIn" data-wow-delay="1.6s">
  <div class="qvs-testimonial-quote">
    <p>Lorem ipsum ex vix illud nonummy, novum tation et his. At vix scriptaset patrioque scribentur, at pro fugit erts verterem molestiae, sed et vivendo ali Lorem ipsum ex vix illud nonummy, novum tation et his.</p>
  </div>
  <div class="qvs-testimonial-author media">
    <div class="qvs-testimonial-author-img cl">
      <img src="/wp-content/uploads/2015/04/review-3.jpg" alt="">
    </div>
    <div class="qvs-testimonial-author-info bd">
      <span class="qvs-testimonial-author-name">John Doe</span>
      <span>Smashing magazine</span>
    </div>
  </div>
</div>
<div class="qvs-testimonial box-4 wow bounceIn" data-wow-delay="1.9s">
  <div class="qvs-testimonial-quote">
    <p>Lorem ipsum ex vix illud nonummy, novum tation et his. At vix scriptaset patrioque scribentur, at pro fugit erts verterem molestiae, sed et vivendo ali Lorem ipsum ex vix illud nonummy, novum tation et his.</p>
  </div>
  <div class="qvs-testimonial-author media">
    <div class="qvs-testimonial-author-img cl">
      <img src="/wp-content/uploads/2015/04/review-1.jpg" alt="">
    </div>
    <div class="qvs-testimonial-author-info bd">
      <span class="qvs-testimonial-author-name">John Doe</span>
      <span>Smashing magazine</span>
    </div>
  </div>
</div>
<div class="qvs-testimonial box-4 wow bounceIn" data-wow-delay="2.2s">
  <div class="qvs-testimonial-quote">
    <p>Lorem ipsum ex vix illud nonummy, novum tation et his. At vix scriptaset patrioque scribentur, at pro fugit erts verterem molestiae, sed et vivendo ali Lorem ipsum ex vix illud nonummy, novum tation et his.</p>
  </div>
  <div class="qvs-testimonial-author media">
    <div class="qvs-testimonial-author-img cl">
      <img src="/wp-content/uploads/2015/04/review-2.jpg" alt="">
    </div>
    <div class="qvs-testimonial-author-info bd">
      <span class="qvs-testimonial-author-name">John Doe</span>
      <span>Smashing magazine</span>
    </div>
  </div>
</div>
<div class="qvs-testimonial box-4 wow bounceIn" data-wow-delay="2.5s">
  <div class="qvs-testimonial-quote">
    <p>Lorem ipsum ex vix illud nonummy, novum tation et his. At vix scriptaset patrioque scribentur, at pro fugit erts verterem molestiae, sed et vivendo ali Lorem ipsum ex vix illud nonummy, novum tation et his.</p>
  </div>
  <div class="qvs-testimonial-author media">
    <div class="qvs-testimonial-author-img cl">
      <img src="/wp-content/uploads/2015/04/review-3.jpg" alt="">
    </div>
    <div class="qvs-testimonial-author-info bd">
      <span class="qvs-testimonial-author-name">John Doe</span>
      <span>Smashing magazine</span>
    </div>
  </div>
</div>

2 ответа 2

1

самый простой вариант - разбить на нужное количество колонок и к этим колонкам добавлять ваши отзывы

*{
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.reviews{
    text-align: center;
    width: 960px;
    margin: 0 auto;
}
.reviews > li{
    display: inline-block;
    vertical-align: top;
    width: 320px;  
    padding: 10px; 
}
.reviews-item{
    background: #ccc;
    padding: 10px;
    margin: 20px 0;
}
<ul class="reviews">
    <li>
        <div class="reviews-item">
            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. It has survived not only five 
        </div>
         <div class="reviews-item">
            Lorem Ipsum is simply dummy text of the printing and typesetting industry.             
        </div>
          <div class="reviews-item">
            Lorem Ipsum is simply dummy text of the printing and typesetting industry.             
        </div>
     <li>
        <div class="reviews-item">
            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. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. 
        </div>
      <li>
        <div class="reviews-item">
            Lorem Ipsum is simply dummy text of the printing and typesetting industry.             
        </div>  
           <div class="reviews-item">
            Lorem Ipsum is simply dummy text of the printing and typesetting industry.             
        </div>
           <div class="reviews-item">
            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. It has survived not only five 
        </div>
</ul>

MASONRY CSS

*{
    padding: 0; 
    margin: 0;
    box-sizing: border-box;
}

 ul{            
        -moz-column-count: 3;
        -moz-column-gap: 20px;
        -webkit-column-count: 3;
        -webkit-column-gap: 20px;
        column-count: 3;
        column-gap: 20px;
        margin: 20px auto;
        padding: 20px 20px 0 20px;
        position: relative;
        width: 980px;        
}
ul li{        
     display: inline-block;
     list-style: none;            
     margin-bottom: 20px;     
     width: 100%; 
}
<ul>
    <li><img src="https://pbs.twimg.com/profile_images/425063504039538688/sO0mRdKW.jpeg" width="300px">
         
      <li><img src="http://w-uh.com/images/1401/cool_picture.jpg" width="300px">
          
      <li><img src="http://cdn.cutestpaw.com/wp-content/uploads/2014/01/l-These-are-pictures-of-Jari.jpg" width="300px">
          
        <li><img src="http://images4.fanpop.com/image/photos/21900000/Beautiful-Pictures-_-beautiful-pictures-21967793-1024-768.jpg" width="300px">
            
        <li><img src="http://images4.fanpop.com/image/photos/22600000/Random-beautiful-pictures-22607571-500-333.jpg" width="300px"> 
            
         <li><img src="https://pbs.twimg.com/profile_images/425946167050911744/x62a9eBz_400x400.jpeg" width="300px">    
        
          <li><img src="http://ichef.bbci.co.uk/wwfeatures/624_351/images/live/p0/16/0s/p0160sdl.jpg" width="300px">
              
            <li><img src="http://i.dailymail.co.uk/i/pix/2014/01_01/Racecourse_650x311.jpg" width="300px">   
</ul>

1
  • Спасибо, но мне нужно конкретно для моего примера - здесь сложнее: нужно учитывать, что это wordpress и билдер visual composer
    – Вася
    20 мая 2015 в 8:55
0

Чтобы блоки реально занимали все возможное пространство, поможет плагин Masonry

1
  • Спасибо, кэп. я про masonry в начале поста упоминал - как мне это внедрить конкретно в мой проект? пробовал к items добавить классы isotope-item, а к родительскому элементу masonry isotope, но блок с элементами тогда вообще исчезает..
    – Вася
    20 мая 2015 в 9:13

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.