V
V
Valentin Popov2016-10-14 07:47:39
css
Valentin Popov, 2016-10-14 07:47:39

How can I make the block heights the same?

There are 4 blocks in which there is content with different sizes. So here's how to set the height of the blocks so that they do not adjust the height to the amount of content, but have a certain height, regardless of the amount of content.
ba807c1c6999480ebcf8c3e06bcc631c.jpg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Евгений Калибров, 2016-10-14
@elarkov

в старину это делали через table-cell, сейчас можно через flexbox:

<div class="list">
  <div class="item">...</div>
  <div class="item">...</div>
  <div class="item">...</div>
</div>

.list
{
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
 
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}
    .item
    {
        display: -webkit-flex;
        display: -ms-flexbox;
        display: flex;
    }

I
iBird Rose, 2016-10-14
@iiiBird Куратор тега CSS

ну можно заюзать скрипт для выравнивания высоты по максимальному https://jsfiddle.net/cm8ctzL0/9/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question