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 trialJason Brown
8,492 PointsCannot figure this one out?!
Next, use the flexbox property and value that gives every list item inside main-nav evenly distributed widths.
@media (min-width: 611px) {
/* Complete the challenge by writing CSS below */
.main-nav {
display: -webkit-flex;
display: flex;
height: 100%;
}
.main-nav li {
-webkit-align-self: center;
align-self: center;
-webkit-flex-grow: 1;
flex-grow: 1;
margin-left: 8px;
margin-right: 8px;
}
}
3 Answers
Chase Lee
29,275 PointsTake out everything in main-nav li
except for flex-grow: 1;
. You only need that because "Flex" is made to be able to work on it's own without all of the margin and align stuff.
Hope that helps!
Adam Moore
21,956 Points@media (min-width: 611px) {
.main-nav{
display: flex;
}
.main-nav li{
flex-grow: 1;
}
}
The "flex-grow" property sets each item equally spaced, giving each item a value of "1". As long as each of the list items has the same "flex-grow" value, they will be evenly spaced.
Jason Brown
8,492 PointsThanks, I guess I tried to overthink it
Chase Lee
29,275 PointsChase Lee
29,275 PointsYou also don't need the
height: 100%;
or thedisplay: -webkit-flex;
in there.Chase Lee
29,275 PointsChase Lee
29,275 PointsLooks like Adam got to it before me... I guess I better read the page before I go finishing off my answers.