原文地址:http://www.eliostruyf.com/sticky-footer-solution-for-sharepoint-2013/

照搬全文:

OFFICE 365 & SHAREPOINT SEARCH / DEVELOPMENT / BRANDING

Sticky Footer Solution for SharePoint 2013

ON JAN 23, 2013 BY ELIO STRUYF WITH 52 COMMENTS

 

Footers and SharePoint that was the starting point of this blog. Back in August 2010, I blogged about how to create a sticky footer for your SharePoint 2010 sites (blog post can be found hereand here). Now it is time to upgrade this sticky footer solution to SharePoint 2013.

For this sticky footer solution you will only need to add some HTML and CSS markup to the master page html file.

If you used my solution from 2010, you will see that not much has changed.

Adding the HMTL Footer markup to the master page

  • Open the master page its HTML file in your favorite text editor (in this example I will use the seattle.html file);
  • Do a search for the s4-workspace DIV, and add a new wrapper DIV underneath it;
 
 
 
 
 
 

XHTML

 
1
2
<!-- =Wrapper -->
<div class="wrapper">

Wrapper DIV location

  • Go straight to the bottom of the HTML file and find the last DIV closing tag;
  • Replace the DIV's closing tag with the following code:
 
 
 
 
 
 

XHTML

 
1
2
3
4
5
6
7
8
    <!-- =Push is needed for the footer to be correctly placed on the page. ms-dialogHidden used to hide it in the dialogs. -->
    <div class="push ms-dialogHidden"></div>
  </div>
  <!-- =Footer: ms-dialogHidden used to hide it in the dialogs. -->
  <div class="footer ms-dialogHidden">
    <span>This is my SharePoint 2013 Footer</span>
  </div>
</div>

Footer HTML location

  • Save the file

Styling your footer

Now that you've added your HTML markup to the master page HTML file, we only need to style the footer.

The CSS markup looks like this:

 
 
 
 
 
 

CSS

 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
.wrapper {
  min-height: 100%;
  height: auto !important;
  height: 100%;
  /* The bottom margin is the negative value of the footer's height */
  margin: 0 auto -30px;
  overflow: visible !important;
}
.footer, .push {
  /* .push must be the same height as .footer */
  height: 30px;
  /* Multicolumn Layout With Sticky Footer */
  clear: both;
}
.footer {
   background: #0072C6;
   color: #fff;
   line-height: 30px;
   text-align: center;
}
body #s4-workspace {
  margin-bottom: -30px;
}

I paced this CSS code for testing purposes in the following location: "/_layouts/15/images/tests/footer.css".

Sticky Footer Result

The result looks like this:

SharePoint 2013 Footer

SharePoint 2013 Footer Scrolling

JavaScript Solution

During the writing of this blog post Randy Drisgill posted his solution of adding a Sticky Footer via JavaScript. The blog post can be found here.

Download the files

Seattle With Sticky Footer

Footer CSS file

SharePoint固定的Footer的更多相关文章

  1. 懒加载实现的分页&&网站footer自适应

    最近在做手机端,发现下拉刷新和上拉加载的jq控件很少而且自我感觉不好用,比如iscroll之类-- 然后自己写了个懒加载的,也很简单,最基础的代码[不喜勿喷,但蛮实用的] wap手机端懒加载分页: 用 ...

  2. 如何让你的 footer 总是在浏览器底部无论什么分辨率无论什么浏览器?

    一个可以用的CSS驱动的可粘在底部的Footer 我们曾经都或多或少的试过用CSS来把Footer固定在底部的经理,但是他们总是不能正常的粘在底部,不是吗?可喜的是,痛苦的研究如何让footer粘在底 ...

  3. ios解决输入框弹出后position:fixed失效问题

    最近在使用AmazeUI进行仿App Mobile Web开发时遇到了讨论众多的position:fixed问题.position:fixed在安卓2.2以上已经实现,但是在ios8以下系统当小键盘激 ...

  4. CSS布局-圣杯布局

    圣杯布局 圣杯布局很完美(兼容所有浏览器,包括IE6),但是使用了相对定位,布局有局限性,宽度控制要改的地方也多. 第一种方法公用部分: .lgyz, .lzrg, .lrzcg, .lcgrz, . ...

  5. 小技巧css解决移动端ios不兼容position:fixed属性,无需插件

    移动端开发仿app头部底部固定设置position:fixed,android2.2以上已经实现.但是在ios8以下系统,当小键盘激活时,都会出现位置浮动问题.如图: 如何解决: 查阅资料之后想到一下 ...

  6. IOS 键盘弹出导致的position:fixed 无效问题

    解决办法(还未测试): 只需要在中间部分外层div添加css样式position:fixed;top:50px; bottom:50px;overflow:scroll;就可以实现效果,无需插件.可拷 ...

  7. ionic基础知识

    ion-header-bar(头部 页眉) 在内容顶部添加一个固定header栏. 用法 <ion-header-bar align-title="left" class=& ...

  8. 让footer固定在页面(视口)底部(CSS-Sticky-Footer)

    让footer固定在页面(视口)底部(CSS-Sticky-Footer) 这是一个让网站footer固定在浏览器(页面内容小于浏览器高度时)/页面底部的技巧.由HTML和CSS实现,没有令人讨厌的h ...

  9. sharepoint 2010 页面添加footer方法 custom footer for sharepoint 2010 master page

    转:http://blog.csdn.net/chenxinxian/article/details/8720893 在sharepoint 2010的页面中,我们发现,没有页尾,如果我们需要给页面添 ...

随机推荐

  1. Qt的零碎知识

    1.QObject是所有Qt对象的基类,他给C++的类带来了若干新的功能.使用Q_OBJECT宏能声明一个C++类为一个QObject.如: class Notepad : public QMainW ...

  2. 使用tomcat作为web应用容器时,启用新线程找不到Session的问题

    今天做一个功能,为了快速响应前端,业务完成后,另起了一个线程做一些不影响业务的统计工作,然后立即将业务操作结果返回给前台. 结果在新线程里报空指针找不到request对象.检查了下,我们用的是stru ...

  3. AssetBundle系列——打包前进行平台检测

    在生成AssetBundle的时候,如果目标平台和当前平台不一致,Unity3D会自动将当前平台转换为目标平台. 如果项目中资源量比较大,这个转换过程是相当漫长的,并且不能够强行中止. 所以最好在Bu ...

  4. 解决 ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)异常

    ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510) 解决方案: 在java_opts="-Xd ...

  5. Shell基础整理

     Shell的作用是将用户输入的文本命令转换成内核能识别的数据指令交给内核进行执行,内核需要翻译成二进制交由CPU底层来执行     用户层->Shell->调用对应应用程序->ke ...

  6. LeetCode——Merge k Sorted Lists

    Discription: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its ...

  7. JS&CSS文件请求合并及压缩处理研究(一)

    在我们日常的网站开发工作中,一个页面难免会引用到各种样式及脚本文件.了解Web开发的朋友们都知道,页面引用的每一个: <link href="style.css" rel=& ...

  8. 设计模式之Iterator模式(2)

    这篇文章比较简单,作一个笔记. 模拟Iterator. Iterator接口: package cn.asto.Interator; public interface Iterator { publi ...

  9. Qt之QAbstractItemView视图项拖拽(二)

    一.需求说明 上一篇文章Qt之QAbstractItemView视图项拖拽(一)讲述了实现QAbstractItemView视图项拖拽的一种方式,是基于QDrag实现的,这个类是qt自己封装好了的,所 ...

  10. [团队项目]sprint3 & 团队贡献分

    希望各组认真准备,拿出最好的阵容最好的状态,展示一学期的学习与工作成果. 各组注意完成sprint3的博客,写上团队贡献分. 将演示PPT(如果有)和代码上传到github. 截止日期:2016.6. ...