D
D
Daaria2020-08-31 02:45:42
Flexbox
Daaria, 2020-08-31 02:45:42

How to align one flex item to the front and another to the center?

It is necessary to make the layout of the header so that the "Home" button is at the beginning, and the logo is in the center:
5f4c3a11b4b90392945918.png

How can this be done?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Ankhena, 2020-08-31
@Daaria

one.

position:absolute
top: 0;
left: 50%;
transform: translateX(-50%)

2. parent
display: grid;
grid-template-columns: 1fr auto 1fr;

3. Bad option
Flex
Parent set after.
Give this after and Home the same width (with a margin).
Center left and right margin to auto

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question