Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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,559 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!