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 trialAndrea Monty
2,724 PointsSticky footer height
Hi everyone this is not a question but this is some help as the video seems off a little. For the calc function Guil uses 89px but if you inspect your footer it should say 112px. So you need to adjust the function. Instead of calc(100vh - 89px) adjust it to calc(100vh - 112px). This should take the scrollbar out completely.
5 Answers
Brian Jensen
Treehouse StaffIt is because of this CCS rule that removes padding and margins from the total dimension:
* {
box-sizing: border-box;
}
So it removes the padding from this, on its final height calculation:
.main-footer {
text-align: center;
padding: 2em 0;
background: #d9e4ea;
}
Andrea Monty
2,724 PointsI was just making an observation as others had had problems. This was by no means to become an attack on me and i will not be brought into the drama. Whatever you're seeing is obviously different. I have been studying this for over a year through different courses and this happens. I am done with this conversation.
Andrea Monty
2,724 PointsI am using Chrome and this particular video lesson i do not think it had the box-sizing property. But I am not sure now as I am on another lesson now.
Benjamin Hedgepeth
5,672 PointsI see this as an easier approach towards creating a sticky footer:
https://teamtreehouse.com/library/css-layout-basics/positioning-page-content/fixed-positioning
Yassin Mzaik
Courses Plus Student 7,454 Pointsjust had a very similar issue,
its because the <p> element inside your footer has a mragin,
remove it and the height should be 89px
use this code in styles.css
footer p { margin: 0; }
ywang04
6,762 PointsFinally, I found that Guil uses the <span> element under <footer> instead of <p> element at the end of this section. Previous provided project file uses <p> element.
<footer class="main-footer">
<span>©2015 Residents of The Best City Ever.</span>
</footer>
If we use <p> element, the height is not 89px due to the margin top and bottom value for <p> element.