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

CSS CSS Basics (2014) Enhancing the Design With CSS Media Query Basics

Leo Penaloza
Leo Penaloza
8,426 Points

The seagreen color is not displaying, nor as the p colors?

/Media Queries/

@media (max-width: 960px) { body{ /* background: forestgreen;*/ }

@media (max-width: 480px) { body { background: red; }

@media (min-width: 481px) and (max-width: 700px) { body { background: seagreen; } p{ color:white; } }

Does the background change to red on the smallest display rule?

Leo Penaloza
Leo Penaloza
8,426 Points

yes, but that is 480px

Leo Penaloza
Leo Penaloza
8,426 Points

I was able to fix it, I was missing some brackets, but thanks for the help anyways :)

Gari Merrifield
Gari Merrifield
9,597 Points

oh, yeah, with those brackets missing, your were still inside the first media query, and it was never picking up the others.

1 Answer

Which brackets? I'm having the same issue and I can't figure it out

@media (min-width: 481px) and (max-width: 700px) { body { background: seagreen; } p { color: white; } }

C SB
C SB
1,821 Points

This is my full code for that portion:

@media (max-width: 960px) { body { background: royalblue; } }

@media (max-width: 480px){ body { background: darkred; } }

@media (min-width: 481px) and (max-width: 700px) { body { background: seagreen; }
p { color: white; } }

I was also having issues with the seagreen, but after reviewing my code, I notice some colons missing. It may just be something small missing. Hope this helps you a bit. I'm a beginner, and learning as well. Good luck!