I
I
Ivan-P2015-02-13 23:48:37
css
Ivan-P, 2015-02-13 23:48:37

How to make two columns the same height in bootstrap?

It is necessary to make 2 columns of the same height in the bootstrap.
The right side will be the text, and the left side will be the table of contents with vertical-align: middle.
c38775f703314553aba3ab4637b97456.jpg
I tried to add another class to ROW:

.n-cols {
  display: table;
}

and columns respectively:
.n-cols > div {
  display: table-cell;
  vertical-align: middle;
}

but the column with the table of contents stubbornly does not want to gain height more than the height of the content inside.
UPD
It turns out float: right (which is given to bootstrap columns) and display: table-cell don't work together! If I set the columns to float:none, the alignment works as in the picture, but the bootstrap grid refuses to work in this area..
How to solve the problem?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Roman, 2015-02-13
@paradoxo

Have you tried adding a custom column style? With indication of height.

M
MacDag, 2015-02-14
@shatov

try custom style

R
Roman, 2016-01-14
@arkanroman

in your css via media for smaller extensions where you don't need the same height undo table-cell and float or write display:inline-block for these blocks; vertical-align:middle; and these blocks will be centered relative to each other

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question