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 Build a Three Column Layout

Joseph Fraley
STAFF
Joseph Fraley
Treehouse Guest Teacher

I'm stuck with 2 columns, what's wrong with my media query?

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

/***************************************
                HEADING
***************************************/
#primary {
    width: 50%;
    float: left;
}

#secondary {
    width: 40%;
    float: right;
}

/***************************************
                PAGE PORTFOLIO
***************************************/


#gallery li {
        width: 28.3333;
}

#gallery li:nth-child(3n+1) {
    clear: left;
}

}

    <div id="wrapper">
        <section>
            <ul id="gallery">
                <li>
                    <a href="Images/numbers-01.jpg">
                        <img src="Images/numbers-01.jpg"alt="">
                        <p>Experimentation with color and texture</p>
                    </a>
                </li>

Instead of three columns, I get 2 columns and three rows, without respect to the screen size. The 3rd image is always alone in its row, so that there is a blank space where the 4th image should be. Instead, it starts the 3rd row

1 Answer

At a glance i can see you are missing a % sign. View below

#gallery li {
        width: 28.3333%;
}
Joseph Fraley
Joseph Fraley
Treehouse Guest Teacher

That's exactly it. I knew it was a typo, but I wasn't seeing it. Thanks a lot Chyno!

=) Glad i could help!