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

HTML How to Make a Website Responsive Web Design and Testing Refactor the Layout

Help with a Challenge.

For this task it asks me to : "Inside the media query, select the list items inside the gallery and add a width of 28.3333%."

so at the top I type:

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

and it says that i am wrong. Can anyone help me out?

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

}

}

5 Answers

I should of searched the forums before hand:

https://teamtreehouse.com/forum/challenge-task-refactor-the-layout

It turns out that they had already written the "@media screen and (min-width: 480px) {}" at the bottom of the list.

one person said "respect the order of the lists..." I will have to check that from now on.

Thank you everyone for responding so quickly!

Erik McClintock
Erik McClintock
45,783 Points

Andre,

In the code you wrote above, the first thing I'm noticing is that you don't have a semi-colon after your percentage value.

Try that and see if it works.

Erik

Thank you for that, there should for sure be a ; there.

The width declaration does not need to be in brackets.

nevermind....

Erik McClintock
Erik McClintock
45,783 Points

It's a little confusing when written like this, but the curly braces that he has around the width declaration are actually correct and necessary. If you write it out in the more familiar way...

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

...it's easier to recognize.

:)

Erik

I should of searched the forums before hand:

https://teamtreehouse.com/forum/challenge-task-refactor-the-layout

It turns out that they had already written the "@media screen and (min-width: 480px) {}" at the bottom of the list.

one person said "respect the order of the lists..." I will have to check that from now on.

Thank you everyone for responding so quickly!

Yes, i recover the answer. @media screen and (min-width:480px){ #gallery li{
max-width: 28.3333%;

}

}