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

Please check the code challenge below from MEDIA QUERIES and let me know where I have gone wrong-thanks !

Create a media query that sets the 'body' element's background color to #FF6347 and its text color to white if the viewport width is 768px or less.

Important: The code you write in each task should be added to the code written in the previous task. Recheck Work

Bummer! Did you specify the right background color?

@ media screen and (max-width:768px){ body{ background:#FF6347; color:#FFF; } }

It worked ! Can't believe I couldn't debug that !!!

2 Answers

There's no space following the @ it's @media not @ media. Hope that helps.

Instead of hexadecimal color just do white and put a space between the declaration and the value. Last take out the space that is between @ and media.

Hope that helps.

I disagree, I think sticking to hex instead of keywords is a good habit for beginners.

It's just for the code challenge.

I find a lot of time that the reason students get it wrong is not because of the subject that they're working on but the color value.

Treehouse usually wants a keyword value like lightblue unless otherwise specified, like when they ask: "Give the body element a hexadecimal color of: #B937FD."

Hmm, I suppose so, but I've never come across that when using white and black in hex, I was just copying what Guil did.

I'm not sure with what colors it does that.But I find it a common problem in the forum, so that is why I thought of it.