Bootstrap页脚粘底 - 滚动条

时间:2014-05-14 16:56:29

标签: css twitter-bootstrap sticky-footer

我在这里徘徊我做错了什么。我试图摆脱滚动条(垂直)。我试过去除衬垫甚至调整高度。无法弄清楚我可能错过了什么。非常感谢

http://jsfiddle.net/jSB53/embedded/result/

/* Sticky footer styles
      -------------------------------------------------- */

html, body {
    height: 100%;/* The html and body elements cannot have any padding or margin. */
}
/* Wrapper for page content to push down footer */
#wrap {
    min-height: 100%;
    height: auto !important;
    height: 100%;
    /* Negative indent footer by it's height */
    margin: 0 auto -70px;
     /* Pad bottom by footer height */
  padding: 0 0 60px;
}

#footer {
    background-color: #ee3124;
    color: #FFFFFF;
    height: 70px;
    padding: 20px 0 0;
}

.navbar-default {
    border-bottom: 5px #ee3124 solid;
    background-color: #fff;
    margin-top: 20px;
    height: 33px;
    -webkit-box-shadow: 0 4px 4px -2px #C7C7C7;
   -moz-box-shadow: 0 4px 4px -2px #C7C7C7;
        box-shadow: 0 4px 4px -2px #C7C7C7;

}

/* Lastly, apply responsive CSS fixes as necessary */
@media (max-width: 767px) {
#footer {
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
}
}

1 个答案:

答案 0 :(得分:0)

由于您已将页脚高度设置为70px,因此您还需要调整#wrap底部填充..

/* Wrapper for page content to push down footer */
#wrap {
  min-height: 100%;
  height: auto !important;
  height: 100%;
  /* Negative indent footer by its height */
  margin: 0 auto -70px;
  /* Pad bottom by footer height */
  padding: 0 0 70px;
}

http://www.bootply.com/rl77rU0NgR