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 Unused CSS Stages Media Queries Adaptive Layouts with Media Queries

Media Queries Challenge

I'm not sure what i'm doing wrong in the challenge listed below. I also listed below that what I thought was the right answer.

Challenge:

Under "Tablets to Desktop," create a new media query that floats .logo left and .main-nav right if the viewport is 769px or wider. Then, add all other "Tablets to Desktop" rules inside the media query. Finally, create a new property inside the .extra rule that displays it as a block element.

/* Phones to Tablets */
@media all and (min-width: 481px) {
  .col {
    float: left;
  }
.main {
    width: 65.957446808511%;
}
.secondary {
    width: 31.914893617021%; 
}
.secondary,
.extra {
    margin-left: 2.127659574468%;
}

/* Tablets to Desktop */
@media all and (min-width: 769px) {
  .logo {
    float: left; 
  }
  .main-nav {
    float: right;
  }
.main {
    width: 40.425531914894%;
}
.extra {
    width: 23.404255319149%;
    display: block; 
}
  }
Dave McFarland
Dave McFarland
Treehouse Teacher

Hi Amanda Isaacson

Your CSS code wasn't showing up correctly. I fixed it in your post. For the future, to put HTML/CSS/JavaScript in a forum post:

  1. hit return to create a new line and type three back tick characters ```

  2. hit return to create another new line and paste your HTML

  3. hit return and add three more back tick characters: ``` The back tick character isn't the same as the single quote -- ' -- mark; the back tick is located on the same key as the ~ on most keyboards.

Also to add correct color highlighting add the name of the language after the back ticks like this: ```CSS. Here's what CSS should look like in a forum post:

#gallery li {
  float: left;
  width: 45%;
}

5 Answers

Dave McFarland
STAFF
Dave McFarland
Treehouse Teacher

You're missing a } at the end of the "phones to tablets" media query. There should be one more } after the .secondary, .extra rule. That will close up the media query.

Dave McFarland
STAFF
Dave McFarland
Treehouse Teacher

Hi Amanda Isaacson

Can you post ALL of your CSS code for this challenge? You need both the "phones to tablets" CSS and the "tables to desktop" CSS in the style.css file. There must be a problem somewhere else in the CSS, because the code you submitted worked fine for me.

Just did

Just did

That was it, thank you!