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


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.