-2

I have a flexbox container row and there are three items inside. I want one of them to be in the very center but I want the other two 2 to be slightly over it and to the most left and to the most right respectively. I want something like this:

Image

I tried with aligning and justify content but it did not work.

Thanks in advance.

Umutambyi Gad
  • 4,082
  • 3
  • 18
  • 39
Fiphe
  • 320
  • 3
  • 18

1 Answers1

0

Here is an illustration of what you want. Just give the middle element a margin-top:

.container {
  display: flex;
  justify-content: space-between;
}

.container div {
  width: 50px;
  height: 100px;
  background-color: red;
}

.center {
  margin-top: 50px;
}
<div class="container">
  <div class="right"></div>
  <div class="center"></div>
  <div class="left"></div>
</div>
Omri Attiya
  • 3,917
  • 3
  • 19
  • 35