@albezver

Align-content: stretch не выравнивает строки. В чем проблема?

Задал родительскому контейнеру display: flex и align-content: stretch, но содержимое дочек не выравнивается.

<section id="choose-item">

            <h2>
                Lorem ipsum dolor 
            </h2>
                <div class="goods">
                    <figure>
                        <img src="image_1.png" alt="image_1">
                        <figcaption>
                            <h3>
                                Lorem ipsum dolor 
                            </h3>
                            <p>
                                Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusantium velit quam, repudiandae nulla mollitia 
                            </p>
                            <div class="price_weight">
                                <p class="price">
                                    100 ₽
                                </p>
                                <p class="weight">
                                    50 г. 
                                </p>
                            </div>
                            <a href="#">
                                Добавить в корзину
                            </a>
                        </figcaption>      
                    </figure>
                    <figure>
                        <img src="image_2.png" alt="image_2">
                        <figcaption>
                            <h3>
                                Lorem ipsum dolor 
                            </h3>
                            <p>
                                Lorem ipsum dolor sit amet, consectetur adipisicing elit. Impedit soluta perspiciatis sit fugit odio fuga hic libero quis in pariatur. Nihil necessitatibus sint unde architecto alias debitis, corporis modi corrupti!
                            </p>
                            <div class="price_weight">
                                <p class="price">
                                    100 ₽
                                </p>
                                <p class="weight">
                                    50 г. 
                                </p>
                            </div>
                            <a href="#">
                                Добавить в корзину
                            </a>
                        </figcaption>      
                    </figure>
                    <figure>
                        <img src="image_3.png" alt="image_3">
                        <figcaption>
                            <h3>
                                Lorem ipsum dolor 
                            </h3>
                            <p>
                                Lorem ipsum dolor sit amet, consectetur adipisicing elit. Impedit soluta perspiciatis sit fugit odio fuga hic libero quis in pariatur.
                            </p>
                            <div class="price_weight">
                                <p class="price">
                                    100 ₽
                                </p>
                                <p class="weight">
                                    50 г. 
                                </p>
                            </div>
                            <a href="#">
                                Добавить в корзину
                            </a>
                        </figcaption>      
                    </figure>
            </div>
        </section>


body, html {
    height: 100%;
    font-family: PT Sans Caption, sans-serif;
}

section#choose-item h2 {
  font-size: 30px;
  text-align: center;
  font-weight: bold;
  color: #22788d;
  padding: 60px 0 50px 0;
  padding-bottom: 50px;

}

section#choose-item .goods {
  width: 72%;
  padding-bottom: 50px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  margin: 0 auto;
      -ms-flex-line-pack: stretch;
      align-content: stretch;
}

section#choose-item figure {
  -ms-flex-preferred-size: 25%;
      flex-basis: 25%;
  -webkit-box-shadow: 0px 0px 35px 0px rgba(0, 0, 0, 0.1);
          box-shadow: 0px 0px 35px 0px rgba(0, 0, 0, 0.1);
  padding: 20px;
}

section#choose-item figure img {
  margin: 0 auto;
  display: block;
}

section#choose-item figure figcaption h3 {
  font-size: 20px;
  color: #214461;
  margin: 28px 0;
}

section#choose-item figure figcaption p {
  font-size: 16px;
  color: #1a3b3b;
  line-height: 21px;
}

section#choose-item figure figcaption .price_weight {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
  margin: 30px 0;
}

section#choose-item figure figcaption .price_weight .price {
  font-size: 18px;
  font-weight: bold;
  color: #214461;
}

section#choose-item figure figcaption .price_weight .weight {
  font-size: 18px;
  color: #214461;
}

section#choose-item figure figcaption a {
  padding: 15px 35px;
  color: #ffffff;
  background-color: #76ba16;
  text-align: center;
  font-size: 16px;
  text-decoration: none;
  vertical-align: middle;
}
  • Вопрос задан
  • 83 просмотра
Решения вопроса 1
Ankhena
@Ankhena Куратор тега CSS
Нежно люблю верстку
Всё у вас выравнивается. Высота всех блоков одинаковая https://jsfiddle.net/df7zyq4r/

А вы какого эффекта ждете?
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы