Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.


Media queries and break points

Having trouble with this code challenge http://teamtreehouse.com/library/content-defined-breakpoints

Here's my code and it works, what can i do to pass the challenge?

@media screen (max-width: 705px) { .grid_1, .grid_2, .grid_3, .grid_4, .grid_5, .grid_6 { width: 100%; } }

3 Answers

Elliott Frazier
Elliott Frazier
Courses Plus Student 9,647 Points

You need to add 'and' between 'screen' and '(max-width: 750px)' like this:

@media screen and (max-width: 705px) { 
    .grid_1, .grid_2, .grid_3, .grid_4, .grid_5, .grid_6 { 
        width: 100%; 

Hai Xia,

Make sure that you are using "only" , "and" at proper places in code.


James Barnett
James Barnett
39,199 Points

I removed your code, because here on the forum we try not to just give away the answers to the Treehouse code challenges.

Remember, the purpose of this forum is to help users learn how to troubleshoot their own issues. So rather than give someone the correct code, we usually prefer to stick with explanations and hints.

Try instead, explaining briefly why their code doesn't work and giving a small hint as to how they can fix it.

My bad.i forgot to think about that. i changed my replay . Hope that should be the right way of a reply for code challenge questions :)

James Barnett
James Barnett
39,199 Points

gopinath para - That certainly gives the original poster a hint on how to fix it. But it doesn't point them in the right direction on what their original mistake was. I usually start with something along the lines of, how does their code not conform to the rules of syntax.

thanks guys.