A
A
Alex_872019-05-17 10:01:02
Flexbox
Alex_87, 2019-05-17 10:01:02

Why doesn't width work on child flex elements?

Good afternoon! I ran into a problem... child flex items don't respond to width at all. Below is the code! Please help me figure out why this is happening.
https://codepen.io/Alexei_87/pen/BeRqgO?editors=1111
PS Please note that with width: 700px, the element with the row-block class is actually 232px

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AbcEnt03, 2019-05-17
@AbcEnt03

Because you have max-width:1160px;
1160 / 5 = 232px; flex divides the width for everyone equally, you set width:700px; for .row-block it won't even fit 2 blocks in a row so flex divides its maximum width into 5 blocks. if you want them to move to the bottom add flex: wrap;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question