N
N
NotLogo2021-10-12 19:07:18
css
NotLogo, 2021-10-12 19:07:18

How to arrange 3 flex items in one line and align them first-left, second center, third right-aligned parent?

Tell me, please:

There is a site header that contains:

  1. Left block: Logo and phone numbers
  2. Center block: menu
  3. Right block: icons: search, accounts, etc. etc.


ZMXvIzZ.png

  • Each of these blocks is of arbitrary, non-fixed length due to dynamic content.
  • Each of the blocks must be flex or inline-flex elements to position child elements
  • All three blocks must be aligned vertically with respect to each other.
  • Parent has fixed max-widh and width: 100%

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rucklless, 2021-10-12
@Rucklless

<section class="space-between">
   <div></div>
   <div></div>
   <div></div>
</section>

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

https://codepen.io/rucklless/pen/yLoNyRW
here you can read more
https://webref.ru/css/justify-content

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question