D
D
denism3002018-10-10 19:58:40
css
denism300, 2018-10-10 19:58:40

How to align elements inside blocks vertically?

There is a container

<div class="row">
  <div class="col-xs-12 col-md-3 logo-container"></div>
  <div class="col-xs-12 col-md-4 search"></div>
  <div class="col-xs-12 col-md-5 ph-cart"></div>
</div>

How to vertically align content?
I do it like this:
.row {
  display: -webkit-flex;
  display: -o-flex;
  display: -ms-flex;
  display: -moz-flex;
  display: flex;
  align-items: center;
}

everything is ok, but in the adaptive mode, the containers do not line up in a column, because default flex-direction: row.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
milonski, 2018-10-13
@denism300

Well, make the vertical direction in the adaptive version.

M
MegaPuxapb, 2018-10-10
@MegaPuxapb

col -am add class:
align-self-center

G
Greg Orekhov, 2018-10-11
@XuTpbIu_KoTe

line-height set the same, the size of the line height (well, or the height of the logo)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question