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 Layout Basics CSS Layout Project Column Layout with Media Queries

Wadzanai Mufunde
PLUS
Wadzanai Mufunde
Courses Plus Student 9,174 Points

My columns won't work correctly.

I believe I've written the code correctly. Maybe I haven't. My output is wrong though. What I end up getting is everything on one column floated to the left, with a huge blank on columns 2 and 3. How do I fix this please?

@media (min-width: 769px) {

    .container {
        width: 90%;
        margin: 0 auto;
    }

    .name 
    .col {
        float: left;
    }

    .primary,
    .secondary {
        width: 50%;
    }

    .main-nav {
        float: right;
    }

    .main-nav li {
        display: inline-block;
        margin-left: 15px;
    } 

    .tagline {
        font-size: 1.4em;
    }


    /* ---- Float clearfix ---- */

    .clearfix::after {
        content: " ";
        display: table;
        clear: both;
    }

}

@media (min-width: 1025px) {

    .container {
        width:  80%;
        max-width: 1150px;
    }

    .primary {
        width: 40%;
    }

    .secondary,
    .tertiary {
        width: 30%;
    }
}

1 Answer