M
M
MFNIK2019-05-15 15:11:01
css
MFNIK, 2019-05-15 15:11:01

How to make permanent 3 columns in flexbox, regardless of the width of the elements?

Good afternoon, please tell me how to make always three columns in the parent having the property display: flex; regardless of the width of the elements.
Now like this:

<div class="wrapper">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>

wrapper {
width: 100%;
display: flex;
flex-direction: row;
flex-wrap: wrap;
height: 500px;
}
.item {
width: 30%;
height: auto;
}

What I need is that regardless of the width of the item element, there will always be 3 columns in the center with equal indents.
And explain to the fool, I'm typing on bootstrap 3, why when adding class="img-responsive" image size 1000x1000 px, it does not shrink to the width and height of the container, but goes beyond the border, I broke my whole head!
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Shohruh Shaimardonov, 2019-05-15
@joeberetta

.wrapper {
/* Добавьте строку ниже */
justify-content: space-between;
}

Here I myself studied about flexbox. Sufficiently detailed and clearly written

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question