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 trialDiane Carlisle
8,437 PointsMedia Query on Code Challenge
I need help with this one.
#menu {
ul {
li {
@media screen and (max-width: 500px){
text-align: center;
}
}
}
}
4 Answers
idan ben yair
10,288 PointsYour code should look something like that.
@media screen and (max-width: 500px) {
.menu ul li {
text-align: center;
}
}
Hope that helped :)
Jason Anello
Courses Plus Student 94,610 PointsHi Diane,
The only issue is that the ul
is the element with the id
of "menu". You have it set up as if the ul
is within another element that has an id of menu.
You would want to use ul#menu
or #menu
and remove the nested ul
block.
#menu {
li {
@media screen and (max-width: 500px) {
text-align: center;
}
}
}
Diane Carlisle
8,437 PointsStill getting bummer error, even with that.
Open a scope on an <ul> with the ID menu. Inside that, open a scope on a <li> element. Using Sass nesting, add a media query so that the <li> elements will have an attribute of text-align: center when the media is screen and the <li> has a max-width of 500px.
I tried to follow word for word, but it gets pretty confusing.
idan ben yair
10,288 Pointsoh very strange!
I'll try to figure out an answer for you but I know what you mean it could be confusing at times.
Diane Carlisle
8,437 PointsThanks for the feedback! Finally got through it. On to the next challenge! lol
RJ McLain
16,380 PointsRJ McLain
16,380 PointsLooks like you referenced the "menu" class while Diane was referencing the id instead, not sure which one is actually right since I don't know the code challenge specifically, but that is kind of a crucial difference.