1.1.3 • Published 7 years ago

stickyfooter v1.1.3

Weekly downloads
3
License
MIT
Repository
-
Last release
7 years ago

Sticky Footer

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(); //takes 1. child as content and 2. child as footer
  @include stickyFooter('content'); //takes your selector as content and 2. child as footer
  @include stickyFooter('content', 'footer'); //takes your selectors content and 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

  • Chrome >= 28
  • Firefox >= 28
  • MS Edge - all versions
  • Safari >= 9
  • Opera >= 12.1
  • IE - not supported

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) {
  //some sort of fallback
  //which is not executed in other browsers
}