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 Getting Started with CSS Layout Creating a Sticky Footer

Malcolm Stretten
Malcolm Stretten
3,814 Points

Why is Sticky Footer using Flex NOT working?

In Guil's lesson I am using the given HTML. I follow his instructions exactly and the footer does NOT stick to the bottom.

Here is my CSS (Guil's CSS)...

/* ================================= Base Styles ==================================== */ .body { display: flex; flex-direction: column; min-height: 100vh; }

.row { flex: 1; }

3 Answers

Russell Sawyer
seal-mask
.a{fill-rule:evenodd;}techdegree
Russell Sawyer
Front End Web Development Techdegree Student 15,705 Points

You need to make the footer stick to the bottom of the page using space-between.

body {
  justify-content: space-between;
}

This will push the footer to the bottom of the page. You can get some more good information on this site.

Good luck. :sparkles:

Malcolm Stretten
Malcolm Stretten
3,814 Points

Thanks for the reply Russell. But I have just realised that it isn't that i need to add 'justify-content: space-between;'. It's that I had put a full stop in front of 'body'. As soon as I remove the tiny full stop...it works - it just drives you mad, doesn't it!

So, the snippet... .body { display: flex; flex-direction: column; min-height: 100vh; }

.row { flex: 1; }

DOESN'T work but

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

.row { flex: 1; }

DOES!

Russell Sawyer
seal-mask
.a{fill-rule:evenodd;}techdegree
Russell Sawyer
Front End Web Development Techdegree Student 15,705 Points

Spelling mistakes and syntax errors are the most common mistakes.

Glad you found the problem and it's working the way you want it to now.

:sparkles: