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 Flexbox Layout Building a Layout with Flexbox Aligning Items to the Bottom of a Column

Phoebe Tyson
Phoebe Tyson
7,504 Points

Columns display on top of each other instead of next to each other?

My code is exactly the same as the code in the video but at full screen,my columns span the width of the page and are stacked on top of each other instead of next to each other and I can't work out why.

/* ================================= 
  Media Queries
==================================== */

@media (min-width: 769px) {

    .main-header,
    .main-nav,
    .row
  .col {
        display: flex;
    }

    .main-header {
        flex-direction: column;
        align-items: center;
    }

    .col {
        flex: 1;
    flex-direction: column;
    }

  .button {
    margin-top: auto;
    align-self: flex-start;
  }

}

@media (min-width: 1025px) {

    .main-header {
        flex-direction: row;
        justify-content: space-between;
    }

}

2 Answers

Rohald van Merode
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Rohald van Merode
Treehouse Staff

Hi Phoebe,

It looks like you've missed a , in the first rule of your 769px media query. Because of this the display: flex property is no longer being applied on the .row element which causes the elements to stack again.

If you add the , in between .row and .col your code should start working as expected 🙂