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 How to Make a Website Responsive Web Design and Testing Refactor the Layout

fitrobotic
fitrobotic
1,290 Points

Media query is not passing code challenge

Challenge is to select the list items inside the gallery and add a width of 28.3333%.

Here is the code:

@media screen and (min-width: 480px) {
    #gallery li {

  width: 28.3333%;
  }
}

Thanks!

Davina

10 Answers

Peter Nellius
Peter Nellius
6,898 Points

Your code actually passes for me - can you try refreshing and trying again?

Try copying your code from here and re pasting it in the code challenge. What you have is actually correct.

fitrobotic
fitrobotic
1,290 Points

I refreshed and copied code and I got the same response:

Bummer! Be sure to set the width of gallery list items to 28.3333% when the browser is wider than 480px.

I'm starting to think sometimes the code challenges are a bit glitchy.

I know this may sound strange but try adding another closing curly bracket at the end and see if that may fix the glitch. If not I would suggest contacting support...

fitrobotic
fitrobotic
1,290 Points

Thanks Peter and James... i tried the last suggestion. I'm going to email support.

Peter Nellius
Peter Nellius
6,898 Points

Davina,

As a rule of thumb, don't copy your code - retype it and see if you get a working answer.

Peter Nellius
Peter Nellius
6,898 Points

Davina,

As a rule of thumb, don't copy your code - retype it and see if you get a working answer.

Nick Pettit
STAFF
Nick Pettit
Treehouse Teacher

Hi everyone,

I just copied and pasted the code from the original post and the challenge worked fine. I'm not sure what the problem is, but we'll let our developers know about this, because it seems like it's an intermittent problem.

Davina Fisher, if you try again now, are you able to get it to pass? It could have just been a temporary error.

fitrobotic
fitrobotic
1,290 Points

Hi Nick!

I tried again and the communcation problem box popped up and underneath that box it showed the same error: Bummer! Be sure to set the width of gallery list items to 28.3333% when the browser is wider than 480px.

I am writing the code in the main.css file since that is the only option. In the vid the responsive file was used to write this code. Does this have something to do with the error since I'm writing the media query on the first line before all the code that is in the main.css?

Thanks,

Davina

Nick Pettit
Nick Pettit
Treehouse Teacher

Hi Davina,

Are you writing it in the media query at the bottom of the page? The media query is already set up for you, and you should just need to add the code inside of it as you've done in the original post.

fitrobotic
fitrobotic
1,290 Points

Ah...Ok I got it. It worked. Thanks.

Great videos by the way.

Davina