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

Gemma Weirs
Gemma Weirs
15,054 Points

Trying to solve this code challenge but I can't find where I've gone wrong

The instructions are a bit confusing.

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.

The error says: Bummer! Select 'li' tags within the 'ul' that has an ID of '#menu'. Set their text-align property to center.

Here's what I have:

/* Write your SCSS code below. */

@media screen and (orientation: landscape) {
  img {
    width: 360px;
  }
}

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

1 Answer

Luke Buśk
Luke Buśk
21,598 Points

Try to remove "li" after the #Menu. # is an unique ID and it should be enough to just leave it as it is.

Gemma Weirs
Gemma Weirs
15,054 Points

Thanks. I think I misunderstood the nested media query part, and how it works in Sass.

I've passed it now. Thanks for the help.