S
S
squirtazzer2018-02-01 03:07:59
css
squirtazzer, 2018-02-01 03:07:59

How to center div blocks?

<div class="inner">

<img class="aligncenter" src="https://motorr-dv.ru/wp-content/uploads/2018/01/йцц.jpg" alt="" />123123123

</div>
<div class="inner">

<img class="aligncenter" src="https://motorr-dv.ru/wp-content/uploads/2017/02/777.jpg" alt="" />123123123

</div>

{

  display:flex;
  justify-content:center;
}
.inner
{
 
 display:inline-block;
  flex-direction: column;
  text-align:center;
  margin:5rem;
  width:28%;
}

Can't get div blocks to be centered

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin Teploukhov, 2018-02-01
@blood-moon

More or less like this

.linner{
width : 100px;
position: absolute;
Left : 50%;
margin-left: -50px;
}

In general, here: https://habrahabr.ru/post/238449/
It was only necessary to google;)

T
tempick, 2018-02-01
@tempick

Set the blocks to display:inline-block and wrap both of them in a div and set its property to text-align:center

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question