Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
- CSS Reset with Normalize 5:24
- Creating a Layout Wrapper 3:27
- Why Vertical Margins Collapse 3:42
- Centering Page Content and Creating a Full-width Header 4:48
- Layout Wrapper Challenge 2 objectives
- Using a Mobile First Approach 6:21
- Creating a Sticky Footer 5:07
- Getting Started with CSS Layout Review 6 questions

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
In web design, a sticky footer is a footer that sticks to the bottom of the page regardless of the amount of content on the page.
Sticky footer tips
If you still see a gap below the footer in browsers like Firefox and IE, or when you change the browser's zoom, give .main-footer
a height
or min-height
value of 89px
.
Resources
Video review
If a page’s content is shorter than the height of the browser, the page may display a big, undesirable gap between the bottom of the viewport and the footer. In the markup, add a new <div>
that wraps the header and main container elements.
<div class="wrap">
<div class="main-header">
<div class="container">
...
</div>
</div>
<div class="container">
...
</div>
</div> <!-- /.wrap -->
Use calc()
to write a mathematical expression that will subtract the footer height from the viewport's total height.
.wrap {
min-height: calc(100vh - 89px);
}
Related videos
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Janina Alvarez
8,083 Points1 Answer
-
Sherrie Jeffers
Front End Web Development Techdegree Student 7,909 Points1 Answer
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up