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.
Is using flex-grow better than using margin-top: auto for this exercise?
When I play around with the code it works also by applying margin-top: auto; to the main-footer. I'm just wondering if there are any downsides to using margin-top: auto; ?
Is there a preferred way, or are there numerous ways to create a sticky footer?
Christopher DeboveCourses Plus Student 18,372 Points
There's different ways to create a sticky footer. In this example is by making the main content grow vertically to make the footer stick to the bottom.
But like you did it, by setting a margin-top: auto to your footer is more semantic, because you're really sticking your footer to the bottom.
Try adding a background to the .row element to see the differences between the 2 solutions.