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 trialChris Martinez
11,715 Pointswhere did my code go wrong? i've tried retyping the code multiple times and refreshing my browser
@media screen and (min-width:660px){ body{ background: darkgreen; } }; and btw, i typed "background-color: navy" for the previous challenge, and it worked. when choosing a background color, does either code work the same?
1 Answer
Rich Donnellan
Treehouse Moderator 27,696 PointsChris,
From your example, it looks like you are adding an unnecessary semicolon after the final curly brace }
; this may be causing your problem. Otherwise, this is valid CSS. Code example uses background-color
, but background
will also work (preference).
@media screen and (min-width:660px) {
body {
background-color: navy;
}
}
Also, background
and background-color
can be used interchangeably; the former is used for short-hand (adding multiple properties). For example:
background: #000 url(images/bg.png) no-repeat top right;