Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS CSS Flexbox Layout Building a Layout with Flexbox Creating a Sticky Footer with Flexbox

Yvette Pascacsio
Yvette Pascacsio
5,199 Points

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
216,865 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.