3

Если заполняется один из блоков, то оба блока принимают наибольшую высоту. Вариант с фиксированной высотой не подойдет. будет ли правильно сделать блокам display:table или всё же есть более правильный способ?введите сюда описание изображения

1 ответ 1

4

Вот Вариант с flexbox։

.list
    {
        width: 400px;
        display: -webkit-flex;
        display: -ms-flexbox;
        display: flex;

        -webkit-flex-wrap: wrap;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
    }
    .list__item
    {
        width: 40%;
        background: #3e3e3b;
        display: -webkit-flex;
        display: -ms-flexbox;
        display: flex;
        padding: 2%;
        margin: 0 3%;
        color: #FFFFFF;
    }
<ul class="list">
    <li class="list__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.</li>
    <li class="list__item">Lorem Ipsum is simply dummy text of the printing and typesetting industry.</li>
    <!-- остальные элементы -->
</ul>

2
  • Ширина обязательно должна быть фиксированной или можно в процентах?
    – stiv
    30 июн 2017 в 10:28
  • @StepanIvanov с шириной можно манипулировать как угодно. 30 июн 2017 в 10:29

Ваш ответ

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

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