DEV Community

Cover image for Learn CSS Flexbox in 5 Minutes

Learn CSS Flexbox in 5 Minutes

Per on July 09, 2019

In this post, you’ll learn the basics of CSS Flexbox, which has become a must-have skill for web developers and designers in the last couple of yea...
Collapse
 
moopet profile image
Ben Sinclair

When you demonstrate making the search item take up more space, you set it to flex: 1, which is the same as it is already (from .container > div). What should it be instead? I've tried putting in higher numbers but don't know what to use to get it to appear like in your screenshot.

I also think it would be helpful if in your initial HTML example you included the classes you refer to later.

Collapse
 
opeala profile image
Jack Ellis

Hi Ben,

I believe in the example of making the .search take up remaining space, you just need to turn off the .container > div styling so that flex: 1; only applies to .search and not all divs within .container.

Hope this helps/makes sense!:-)

Many thanks, Jack.

Collapse
 
demaine profile image
Colin Demaine • Edited

You have to replace the rule that came before it. So delete .container > div and target the search item with a class name. Also it might be worth considering that you won't see much of a difference on smaller screen sizes or with narrower flex containers.
I put together a visual explanation on Codepen to try and help to explain things and give working demos for you to see the effect in action.

Hope this helps!

Collapse
 
apandey15071991 profile image
Abhinav Pandey

Your style of writing and presenting the tutorial is amazing. Please write more tutorials like this.

Collapse
 
danfco profile image
DanFCo

this was crystal clear and easy to understand... thank you for this!

Collapse
 
emmabostian profile image
Emma Bostian ✨

Nice job!