Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Why flex-grow is not working?

Hi, at the breakpoint on 769 px I want the columns to take the same amount of space so in the flexbox.css in the media query I put the commend flex-grow: 1; for both of the columns. Why it's not working? https://w.trhou.se/wh0q9nhayf

1 Answer

Steven Parker
Steven Parker
231,264 Points

The default flex-basis (auto) adjusts the widths to take up the least vertical space. Try setting a fixed value (0, for example) for flex-basis to make the widths even.

You could also use the shorthand "flex: 1" instead of "flex-grow: 1" to set them both at once.