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 Write CSS Media Queries

Create 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
Erik McClintock
45,783 Points

Valentina.

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

Erik McClintock
Erik McClintock
45,783 Points

Just 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

davidbrodt
davidbrodt
5,943 Points

@media screen and (max-width: 480px) {

body {

background: navy; } }

Thanks!!! :)

Thanks!

0 0
0 0
1,570 Points

this is my code:

@media screen and (min-width: 480px;) {h1 {font-size: 2.5em;}}

why is it not working?

Erik McClintock
Erik McClintock
45,783 Points

Try 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
0 0
1,570 Points

still not responding

Erik McClintock
Erik McClintock
45,783 Points

You 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
0 0
1,570 Points

refreshed page and started working

Thanks!!!!!!!!!!