This is a continuation of my earlier issue (Extending body to cover z-indexed footer when there isn't enough content - which is now solved using css3 height calc as well as the answer provided) whereby the #mainbody
element is scrolling past where it should be.
I've set a bottom margin of 365px:
.mainbody{
[...]
margin-bottom: 365px;
}
as that is the height of the footer it is covering, but for some reason it keeps scrolling higher despite the fact there is no other margin, padding or content pushing it up - Chrome's computed box model in the code inspector is also confirming this for me. I have also removed the margin-bottom line of code and the same thing is still happening.
You can have a look at the code and example here: http://stackoverflow.adamrapley.com/
Thanks :)
Additional code that highlights the area that's not doing what it should:
html,body,#mainbodyholder{
height: 100%;
}
#mainbodyholder{
position: relative;
position:0;
}
#mainbody{
transition: all 50ms;
padding: 0 10%;
height: 100%;
}
.mainbody{
position: relative;
top:0;
min-height: -webkit-calc(100% - 220px);
min-height: -moz-calc(100% - 220px);
min-height: -o-calc(100% - 220px);
min-height: calc(100% - 220px);
background: #E2E2E2 url('../img/ticks.png');
padding-bottom: 20px;
margin-bottom: 365px;
box-shadow: 0px 0px 30px 0px #000000;
padding-top: 220px;
z-index: 2;
}
and the HTML:
<div id="mainbodyholder">
<div class="mainbody container">
<h1 class="title">Title</h1>
<div id="mainbody">
<p>Content</p>
</div>
</div>
</div>