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 CSS Flexbox Layout Building a Layout with Flexbox Creating a Sticky Footer with Flexbox

How is "flex-grow: 1" working on .row and .row hasn't been defined as a flex box?

At least, I don't see where .row is being defined as a flex box.

As everyone has said, since the body is the parent element, .row can now take flex items properties. So there's no need to give display:flex to .row.

2 Answers

flex-grow is a child property, so you should be looking to see if it's parent element is a flex container. Here's a popular guide: https://css-tricks.com/snippets/css/a-guide-to-flexbox/

Steven Parker
Steven Parker
229,644 Points

As Eric pointed out, flex items are child elements of flexboxes. If you look in "flexbox.css" on line 6 you will see where "display: flex" is set on the body element, which is the parent of of the .row's.