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 Adjusting the Layout with Media Queries

Kathryn Moore
Kathryn Moore
1,247 Points

Media Queries not taking

I've looked so closely at the code in the lesson, and can't seem to see anything wrong. Yet, the layout adjustments we made in the media queries for 480px screens (particularly after adding the max-width: 1024px rule,) don't appear when I reduce the viewport. I also ran it through LINT, and it said that it expected an RBRACE { at line 206 (the line above .wildlife rule under the 1024px media query line. )

Snapshot (Media queries are at bottom of style.css file in the css folder) https://w.trhou.se/0wxvfh37nw

Thanks in advance for any help. I'm stuck.

1 Answer

Carlos Gomez
Carlos Gomez
1,246 Points

You haven't closed the bracers correctly. Here's your media query.

@media (max-width: 1024px) {
  .primary-content,
  .secondary-content {
    width: 90%;
  {
  .wildlife {
    padding: 10% 12%;
    margin: 50px 0 20px;
  }
}

It should be like this.

@media (max-width: 1024px) {
  .primary-content,
  .secondary-content {
    width: 90%;
  }     /* <------------- Here's the problem. Now it's fixed. */
  .wildlife {
    padding: 10% 12%;
    margin: 50px 0 20px;
  }
}

I hope that it helped you.

Kathryn Moore
Kathryn Moore
1,247 Points

I looked at that dozens of times. I feel like an idiot :/ Thank you!