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 trialyoav green
8,611 Pointsim still getting the scroll bar
/* =================================
Base Element Styles
==================================== */
* {
box-sizing:border-box;
}
body {
line-height: 1.6;
color: #3a3a3a;
}
a {
color: #fff;
text-decoration: none;
}
/* =================================
Base Layout Styles
==================================== */
/* ---- Navigation ---- */
.name {
margin: 0;
}
/* ---- Layout Containers ---- */
.container {
padding-left: 1em;
padding-right: 1em;
}
.main-header {
background: #3acec2;
padding: 1em 0;
}
.main-footer {
text-align: center;
padding: 2em 0;
background: #d9e4ea;
}
/* ---- Page Elements ---- */
/* =================================
Media queries
==================================== */
@media (min-width: 769px) {
.wrap {
min-height: calc(100vh - 89px); /* 100vh;*/ /*view port relative unit height */
}
.container {
width: 70%;
max-width: 1000px;
margin: 0 auto
}
}
why am i still getting the scroll bar? wrote the exact math calculation in the video
3 Answers
Luke Kennedy
11,661 PointsHi Yoav Green,
I had the same problem as yours. It's actually due to the margin of the last paragraph tag. If you were like me then you didn't start a new workspace. haha. So there is actually a difference in the code though that Guil did in the "Base Element Styles" section from the previous video.
You are missing the (in the "Base Element Styles" section) is the p: last-child { margin-bottom: 0; }
That should do the trick to remove the scroll bar. Hope that helps.
Luke.
yoav green
8,611 Pointsthanks luke :)
Joshua Furmanczyk
4,299 PointsThanks! This also helped me out too. I noticed in dev tools there was a gap between that last paragraph and my footer...but wasn't quite sure how to fix it.
p:last-child makes sense.
yoav green
8,611 Pointsive done that, but im now happy from the fact that the devtool indicated 89px for the footer, and still the calc did not stick it without the scroll bar :/
Wilbon Robinson
14,688 PointsTry adjusting the section of your media query that says "min-height: calc(100vh - 89px)" but make 89px the actual height of your footer in your project or just adjust that number up or down till the scroll bar goes away. Hope this helps.
----Will R
.wrap { min-height: calc(100vh - 89px); /*change 89 px to your footer height to get rid of the scroll bar */ }
yoav green
8,611 Pointsyoav green
8,611 Pointshtml -