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

Matthew Root
Matthew Root
5,392 Points

Not sure why this code challenge is saying my code is wrong for this media query.

/* Is anything wrong with this?*/

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

Hey there,

I cleaned up your code there so it displays properly. In the future, wrap all your code with 3 backticks (the tilde key next to the number 1 key.) and place the name of the language after the first 3 backticks.

Like so...

```languagename

code

```

Cheers,

Huck - :sunglasses:

2 Answers

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Matthew;

Welcome to Treehouse!

Your syntax is great, nice work! Did you put your media query at the bottom of the CSS in the code challenge? If you don't the h1 styling which occurs at line 27 will cascade over your media rule.

Happy coding,
Ken

huckleberry
huckleberry
14,636 Points

Good question!

I didn't even think of that. I bet you it's that simple lol.

Cheers,

Huck - :sunglasses:

Matthew Root
Matthew Root
5,392 Points

Got it! You are exactly right! Thanks!

huckleberry
huckleberry
14,636 Points

I just tried your exact code with a copy paste and it worked just fine. Try restarting the challenge and see if it doesn't work. Sometimes it just bugs out on you.

Cheers,

Huck - :sunglasses: