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

Not sure how to solve this

I've tried several times on this and still can't seem to get it to pass. Following is the code and question:

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.

/* 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;} } }

2 Answers

Sean T. Unwin
Sean T. Unwin
28,690 Points

You used the class operator instead of the id operator - .menu should be #menu

I feel like a big idiot... Thanks Sean

Sean T. Unwin
Sean T. Unwin
28,690 Points

You don't need to repeat the li in the media query as you're already in the scope for that li.

when I remove the li like this : .menu li{ @media screen and (max-width: 500px){ text-align: center; } }

it fails and tells me I need to "select 'li' tags within the 'ul' that has an ID of '#menu'. Set their text-align property to center."