A
A
Alexey2017-03-13 18:37:42
css
Alexey, 2017-03-13 18:37:42

Can't align vertical align middle?

There are two container bootstrap in the header tag which is given a background image. In the first - the menu and logo and in the second there should be text that needs to be aligned in the middle. Vertical-align: middle doesn't work for some reason

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey Sklyarov, 2017-03-13
@0example

create two divs with display:table-cell (don't forget to place them in a block with display:table;) After that, set the vertical alignment for the desired block

A
Andrey Fedorov, 2017-03-13
@aliencash

Yes, you are kidding!
1. codepen.io/aliencash/pen/oZwoRq?editors=1100
2. codepen.io/aliencash/pen/jBwYEb?editors=1100

I
igumenov, 2017-03-13
@igumenov

for vertical-align to work, the element must be of type inline, inline-block or table-cell

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question