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 trialValentina Delfino
5,646 PointsCreate a breakpoint for devices 480 pixels wide or larger. Inside the breakpoint, set the body background to the color n
I write this and is not working... @media screen and (min-width=480px) { body { background:navy; } }
7 Answers
Erik McClintock
45,783 PointsValentina.
You have written the media query correctly, save for one small error - when you specify the device width, you need to replace the equals sign with a colon!
@media screen and (min-width: 480px) {
body {
background:navy;
}
}
Happy coding!
Erik
davidbrodt
5,943 Points@media screen and (max-width: 480px) {
body {
background: navy; } }
Valentina Delfino
5,646 PointsThanks!!! :)
Valentina Delfino
5,646 PointsThanks!
0 0
1,570 Pointsthis is my code:
@media screen and (min-width: 480px;) {h1 {font-size: 2.5em;}}
why is it not working?
Erik McClintock
45,783 PointsTry removing the semi-colon from your media query definition, then your code should work!
You have:
@media screen and (min-width: 480px;) { /* note the semi-colon after "480px;" */
/* etc. */
}
You want to remove that semi-colon:
@media screen and (min-width: 480px) { /* note the lack of semi-colon after "480px" */
/* etc. */
}
Erik
0 0
1,570 Pointsstill not responding
Erik McClintock
45,783 PointsYou may be experiencing a connection issue with the challenge. Your code (after removing that semi-colon) is correct. Try refreshing the challenge if the submit button isn't doing anything, and if it still won't load, try again in a little bit.
Erik
0 0
1,570 Pointsrefreshed page and started working
Thanks!!!!!!!!!!
Erik McClintock
45,783 PointsErik McClintock
45,783 PointsJust remember, in CSS, you assign values to your properties with a colon, so make sure you do the same in your media query declarations :)
Erik