My SharePoint 2010 Sticky Footer Solution


I’ve come across a handful of sticky footer solutions and many of them claiming to work in SharePoint. Most of the CSS ones just can’t cut it b/c of how SharePoint 2010 now adjusts the page height for the scrollbar / Ribbon. It just never seems to work. A few solutions that do work involve jQuery, now I don’t like this b/c now you need to add the reference to the jQuery library. This is just another resource that if not needed I’d rather not add. My solution was written in JavaScript so that no additional resources are needed. Just attach the JavaScript file and adjust it as I’ll demonstrate to get it to work on your site.

For the impatient: Download script here , Read Instructions under the Solution header

Current Issue

So every time I do a new master page with a footer, I am stuck with a page that has no content and the footer is floating way above the bottom of the page like so.

This is using the OOTB V4.master (a copy of course), and my footer placed right above the Developer Dashboard so it’s the last thing inside the #s4-bodyContainer.

(Style put inline for demonstration purposes)

Even if you go outside the #s4-bodyContainer and place the footer, as the last element in s4-workspace you’ll get the same effect. (I’ve added comments this time to show where I am in the master page)

If you go below the s4-workspace, you will get a very undesirable effect, because SharePoint only detects things inside the workspace and uses that to resize the page. SO you’ll see your footer for a second then it will be pushed out of frame!


Again as stated in the problem statement, many of the solutions you’ll find rely on jQuery. This one is in JavaScript so that you don’t have to worry about loading that jQuery library. This solution will analyze the size of the view space and adjust the body container taking in considers of the height of the footer, the ribbon & itself.

Step 1) To utilize this script the placement of your footer must be between the s4-bodyContainer & s4-workspace.

(Comments were added by my and will not be there on the default master page)

Step 2 ) Download the JavaScript file here.

Step 3 ) Add the js file to your SharePoint site

Step 4 ) Add the reference in the Master Page, somewhere before the </head> tag

Once you complete all the steps your footer will now be properly placed at the bottom of a short page. It will even update itself when the page is stretched or shrunk.


38 thoughts on “My SharePoint 2010 Sticky Footer Solution

  1. I like this solution (especially since it does not have a dependency), but why are you using eval() in your code?

    It doesn’t seem like you are gaining anything by using it.


  2. Hi there, like the solution, but when I add it to my master page, I get the footer, but lose the ability to scroll up and down.

    • Hey Ben,
      Thanks for checking out the solution and for the feedback. Excellent work fixing that issue, I’ll be sure to test it out. I will also update the article with the fix and credit you for your work.
      Thank You!
      -Tom Daly

  3. Excellent Solution! Thank you so much! Is there a way to remove the footer from the page when you add items? For example you add a document and below the form you see the footer. Any information would be useful. Thanks again!!!

  4. My site has a fixed with of 980px by using css on s4-bodyContainer, this cause the footer to be on the right of the content area. If I move it up it isn’t sticky 😦 any ideas? Thanks

    • Nick – I’ve looked into this and seem to be fine with 980px on the s4-bodyContainer. I have OOTB v4 only adding in the footer (between the end of s4-bodyContainer and s4-workspace), a custom css (shown below), and the link to the .js file

      #myFooter {
      clear: both;
      height: 30px;
      #s4-workspace {
      text-align: center;
      #s4-bodyContainer, #myFooter {
      width: 980px;
      margin-right: auto;
      margin-left: auto;
      text-align: left;

  5. Hi, after adding the JS file, I’m not getting vertical scroll bar in IE8. IE7 and IE9 work fine. Is this a CSS issue?

  6. Hi Thomas

    This is similar to a solution I had come up with a while back. What I found is that the Javascript is a little delayed coming in (less than half a second) on our site and users can easily see the footer div jump. What I also found out is that this is really the only way to do it. Good post, keep em coming!

    • Yes because of the ribbon and it’s control over the scrolling and page height it will calculate the s4-workspace height, and then my code will extend it if it’s too short to fill the screen size. You are right it’s the only way to do it because of that reason. Thanks for the comment!

  7. Hi Tom,

    Thanks for this fix! It works great on most pages but for some reason it likes to move around on others. For example, if I create a Team Discussion or Wiki library page and there’s no content, the footer appears in the middle of the page with the white space below it.

    Do you know why this would be happening? I should mention we are using Foundation in interim, but would that be a factor?


    • Devon – this means the script is not running, check to make sure that the script is loading on the sub pages. You can do that by adding an alert(“test”); to it.

      I was able to verify that it does work on the Wiki Page and Team Site template as is.

      • Thanks! I checked my script again and saw a mispelled word. Problem solved! Sorry to have made you investigate this one.

  8. This works great! Thank you for posting it. Buuut… there seems to be a few OOTB pages where the content won’t push the footer down for no apparent reason. Like on the Navigation page the footer just stays in the center of the page and the content overlaps it. There are no javascript errors. Any idea what could be wrong?

    • you should always have a css style { clear: both; } on the footer.. if it doesn’t go to the bottom then typically it’s not running. I’ll give the navigation a page a check and see what’s happening.

  9. I have some PerformancePoint Excel Services reports.

    Each of them load with the footer attached. Is there anyway to remove the footer from these reports?

  10. Hi Thomas,

    The stickyFooter works great on my top level SharePoint 2010 sites. However, the footer will not ‘stick’ to the bottom of the page on sub-sites. I’ve put the .css and .js files in a folder on the sub-site’s root folder and referenced them as such in the master page. Any suggestions?

Comments are closed.