Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS

Flexbox Sticky Footer...doesn't want to stick

I'm working through the last video in the Flexbox Layout Series and I can't get the

3 Answers

Branko Zivanovic
Branko Zivanovic
2,684 Points

Instead of selecting element with class .body you should just simply target body element.

body{ min-height:100vh; display:flex; flex-direction:column; } .row{ flex:1; }

sticky footer to stick. Here's a link to the video:

example link

Here's my code:

 /* ================================= 
  Base Styles
==================================== */

.body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.row {
  flex: 1;
}

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

@media (min-width: 769px) {

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

}

@media (min-width: 1025px) {

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

}

I'm really not sure what I'm missing here

Thanks Branko!...I had made that mistake previously and need to catch myself on it. Appreciate it