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

Anthony Rudny
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Anthony Rudny
Full Stack JavaScript Techdegree Graduate 29,494 Points

My code works in my workspaces environment, but not for this quiz question?

Not sure what I'm missing? Code below works great in workspaces when testing.

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

John Coolidge
John Coolidge
12,614 Points

Can you show us your code inside the challenge you mention? Your code does indeed seem to be written correctly, but you could be placing your breakpoint in the wrong area of your CSS.

Thanks!

2 Answers

Steven Parker
Steven Parker
231,269 Points

:point_right: I'll bet that you put your media query near the top of the CSS file.

Media queries should always be added to the end of existing CSS, so when their conditions are met they can override any other rules with the same specificity level.

If you look through the provided CSS, you'll find that it already has a rule that sets the font-size for h1 elements. If the new rule is placed above it, the old one will override it.

Happy coding!   -sp:sparkles: