Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/415.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 引导边栏和页脚工作不正常_Javascript_Jquery_Html_Css_Twitter Bootstrap - Fatal编程技术网

Javascript 引导边栏和页脚工作不正常

Javascript 引导边栏和页脚工作不正常,javascript,jquery,html,css,twitter-bootstrap,Javascript,Jquery,Html,Css,Twitter Bootstrap,我必须为许多使用jQuery和Bootstrap3开发的网页添加页脚。我已经写了以下脚本的基础上做这项工作 // Default $( document ).ready(function() { $('body').append('<footer class="footer">' + ' © 2015 ABC Company. All rights reserved. | Content for inte

我必须为许多使用jQuery和Bootstrap3开发的网页添加页脚。我已经写了以下脚本的基础上做这项工作

// Default
$( document ).ready(function() {
        $('body').append('<footer class="footer">' + 
                               ' © 2015 ABC Company. All rights reserved. | Content for internal use only. | ' +
                               '<a href="mailto:#">Contact Us</a> ' +
                          ' </footer>');
});
这适用于所有页面,但带有边栏的页面除外,边栏与页脚重叠,如下所示

我试图通过添加
边距底部:40px;/*CSS中按页脚高度调整页边距底部*/
。侧边栏
。现在它看起来像下面


如何解决这个问题?我无法为每个页面添加单独的页脚并为其设置样式,因为页面很多。

在页脚的css中添加z-index:600,将使页脚位于所有内容的顶部。

您需要告诉页脚显示在页面上其他元素的前面。使用
z-index
CSS属性应该可以帮助解决这个问题。

感谢您修复了忘记
z-index
html {
  position: relative;
  min-height: 100%;
}
body {
  /* Margin bottom by footer height */
  margin-bottom: 40px;
}
.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  /* Set the fixed height of the footer here */
  height: 40px;
  background-color: #99FFFF;
  padding-top:5px;
}