If using padding-top
is an option, you could use box-sizing: border-box
to calculate the width and height of the box including padding and border, as follows:
#canevas {
min-height: 100%;
margin-bottom: -33px;
padding-top: 50px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
Also it's worth noting that border-box
value is supported on IE8+.
Alternatively, you could add another spacer element as the first child of the #canevas
element to push down the content, as follows:
.spacer {
height: 50px;
}
<body>
<div id="canevas">
<div class="spacer"></div>
<article>My website's content</article>
<div id="push"></div>
</div>
<footer id="footer">Here my footer</footer>
</body>
This will have a promising browser support :)
For further info, you could refer my answer on a similar question on SO here: