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
edward diamond
2,384 PointsPlease 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; } }
2 Answers
Richard Duncan
5,568 PointsThere's no space following the @ it's @media not @ media. Hope that helps.
Chase Lee
29,275 PointsInstead 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.
Thomas MacFarlane
2,430 PointsI disagree, I think sticking to hex instead of keywords is a good habit for beginners.
Chase Lee
29,275 PointsIt'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."
Thomas MacFarlane
2,430 PointsHmm, I suppose so, but I've never come across that when using white and black in hex, I was just copying what Guil did.
Chase Lee
29,275 PointsI'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.
edward diamond
2,384 Pointsedward diamond
2,384 PointsIt worked ! Can't believe I couldn't debug that !!!