G
G
Gleb2020-06-14 12:38:16
css
Gleb, 2020-06-14 12:38:16

How to fix a flex element on one side?

5ee5ef4f0cb33546506148.png

Elements are positioned using flex, justify content: space-between. It is necessary that the blocks do not affect the layout if one of them is removed. Those. even if I remove the logo, the block on the right should stay in place and not move.
PS align-self: flex-end didn't help for some reason.

.header-content {
    max-width: 1000px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 0 auto;
    padding: 50px 0;
}
.logo-img{
    width: 273px;
    height: 100px;
}
.phone-number {
    height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-family: Lato;
    font-size: 30px;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arseny, 2020-06-14
@HannStar

Instead of unmanaged space-between, use margin-left\right:auto;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question