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 Sass Basics (retired) Advanced Sass Concepts Working with Media Queries

can't figure out this code challenge

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 max-width is 500px.

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hey Marty,

It's pretty much the same as the first part of the challenge, but it is the wording of the 2nd challenge that I think is confusing (and not just you).

Where it starts with open a scope on an <ul> with the ID of menu, you need to just ignore the ul part and focus on the ID. From there it's just like the first part where the rest are nested inside of the last.

#menu {
  li {
    @media screen and (max-width: 500px) {
      text-align: center;
    }
  }
}

You select the ID menu -- inside that you select the li tags -- and inside that you declare the media query.

I hope this makes sense. Keep Coding! :)

Thank you Jason. Yes, now it makes sense.