H
H
Hlib2019-09-10 16:30:23
css
Hlib, 2019-09-10 16:30:23

How to push the last element to the edge of flexbox?

Hello, there was a situation when you need to make a block with goods
. Everything will align using flexbox

.bookWrap{
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
}
.book{
     margin: 10px;
     border: 1px solid #000;
     width: 350px;
}

The following situation turns out: 5d77a53bd005a494312089.jpeg
How to press the last blocks to the right edge?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rustam Bainazarov, 2019-09-10
@Mysianio

In this context, no way.
Only if through :last-child and margin.
Or get rid of space-around and do calc(width - indent * 2) a la like this:
Above is a typical implementation of such things on flex.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question