A
A
AlexanderKom2016-12-11 10:58:34
css
AlexanderKom, 2016-12-11 10:58:34

How to set the positioning of a separate flex element along the main axis?

.container {width: 1000px }
.item-1 {width: 300px;}
.item-2 {width: 200px;}
.item-3 {width: 100px;}
Need to push .item-1 to the top,
.item-2 pin to .item-1,
.item-3 pin to the right border of the container
How to do it?) I think to set the container justify-content: flex-start; , and how to push the last element to the right border of the container, but how to position a separate element?
As a fallback use wrapper for .item-1 and .item-2 with justify-content: flex-start; , and .container {justify-content: space-between}, but I don't want to.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Strukov, 2016-12-11
@AlexandrKom

Item3 give margin-left: auto;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question