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 trialLeon Kenedy
Courses Plus Student 9,149 PointsHelp with this code challenge.
http://teamtreehouse.com/library/css-layout-techniques/flexbox-layout/flexbox-layout-challenge
I need the code for number one and two.
5 Answers
Ken Alger
Treehouse TeacherLeon;
Definitely post your code here so folks can assist.
Look over what the questions are asking and break them down step by step.
1) First, let's establish a flex formatting context. Give main-nav the display value that converts its list items into flex items.
.main-nav {}
So now you just need to input the correct property, correct? Check out this resource for possibilities.
2) Next, use the flexbox property and value that gives every list item inside main-nav evenly distributed widths.
Now, given the hints for Challenge Step #1, how can Step #2 be tackled in a similar fashion?
My thought is that at this stage of the learning process having every single CSS property and their associated value possibilities is too large of a task, so at least knowing where to look, or ask like here in the forum, is a huge step.
Happy coding,
Ken
Leon Kenedy
Courses Plus Student 9,149 PointsI am not dumb I got that part.
Ken Alger
Treehouse TeacherLeon;
Sorry you took it that way, it wasn't intended to make you feel like that. I was trying to suggest that each challenge question get broken down into each of it's corresponding parts.
1) Attach X value to Y CSS class, i.e. Make the main-nav class display flex items.
.main-nav {
display: flex;
}
2) Do something to the list items in the main-nav class so you need to be doing something to .main-nav li. So, the next section of code is going to be something inside that element. In this case it wants you to add a value to the flex-grow property, which will control the distribution of widths. In this case, a value of 1 will achieve that. So, the code for parts 1 and 2 of the challenge would be:
@media (min-width: 611px) {
/* Complete the challenge by writing CSS below */
.main-nav {
display: flex;
}
.main-nav li {
flex-grow: 1;
}
}
Again, my apologies for the misunderstanding.
Happy coding,
Ken
Leon Kenedy
Courses Plus Student 9,149 PointsWhat about number 3?
Ken Alger
Treehouse TeacherLeon;
This one uses the order property. To move a particular item to the beginning of the row, assign it the value of "-1".
Ken
Leon Kenedy
Courses Plus Student 9,149 PointsWhat is the code to that?
Ken Alger
Treehouse Teacher.secondary {
order: -1;
}
Ken Alger
Treehouse TeacherLeon;
Same as Step #1 in the Challenge, just another class. There are a couple of different ways this one can be done, not entirely sure how the Challenge Engine interprets them.
Post back if you get stuck.
Ken
Leon Kenedy
Courses Plus Student 9,149 PointsI need help with the fourth one.
Jeff Busch
19,287 PointsJeff Busch
19,287 PointsWhat code have you tried so far?