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

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

.main-nav{
    display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
}

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