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

HTML How to Make a Website Responsive Web Design and Testing Adding Breakpoints for Devices

Slava S
Slava S
3,112 Points

body element not recognized in code

For some reason the workspace is highlighting the 'body' element with red and the media query is not working, but I am not sure what could be wrong with it:

@media screen and {min-width: 480px) { body { background:navy;}

}

Thank you in advance.

2 Answers

Simon Duchaine
Simon Duchaine
14,441 Points

If you wrote the code as you copied it in your comments, it looks like you've used a { instead of ( before your min-width declaration!

@media screen and {min-width: 680px) { body { background:navy;}

in the bold area above you have to different brackets. Happens to the best of us.