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 Layout Techniques Flexbox Layout Flexbox Layout Challenge


just can`t get over this one, it says every li must have the same flex-grow...what am i doing wrong???

.main-nav li {align-self:center; flex-grow:1;


2 Answers

James Ingmire
James Ingmire
11,901 Points

Make sure the parent element of the 'li' display's flex in order to create a flex container; it enables a flex context for all its direct children.

So display the following and should work:

.main-nav {display: flex;}

.main-nav li {flex-grow:1;}

Hope this helps.

Janek Rezner
Janek Rezner
12,973 Points

so what's wrong with leaving align-self:center in (just like in the video)? this code won't work

    display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;

.main-nav li{
  -webkit-flex-grow: 1;
  flex-grow: 1;