A modern easy to use sticky footer mixin with minimal HTML requirements.
Example: zampage.github.io/stickyfooter/
Install with Node: npm install --save stickyfooter
Usage
stickyFooter([string:contentSelector, string:footerSelector])
SCSS
parent{
@include stickyFooter();
@include stickyFooter('content');
@include stickyFooter('content', 'footer');
}
HTML
<parent>
<content></content>
<footer></footer>
</parent>
Notice
- if applied on body the margin needs to be resetted
- you should use box-sizing: border-box; on all elements
Browser Support
Sticky footer will automatically be ignored completely on IE. If you want to use a fallback just for IE this is the way to go:
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
}