首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Twitter Bootstrap Sticky Footer和Jade

Twitter Bootstrap Sticky Footer和Jade
EN

Stack Overflow用户
提问于 2013-05-30 18:44:02
回答 1查看 1.5K关注 0票数 1

使用Express、Jade和Twitter Bootstrap -尝试使用粘性页脚示例。所有内容都会渲染--除了页脚没有粘性。有点违背了目的。有谁走运了吗?

layout.js

代码语言:javascript
复制
    !!! 5
html
    head
        title= title
        script(src='/javascripts/jquery-1.9.1.min.js') 
        script(src='/javascripts/bootstrap.min.js') 
        link(rel='stylesheet', href='/stylesheets/bootstrap.css') 
        link(rel='stylesheet', href='/stylesheets/style.css')
        link(rel='stylesheet', href='/stylesheets/bootstrap-responsive.css')

    body
        block content

index.js

代码语言:javascript
复制
extends layout



block content

  #wrap
    .container
      .page-header
        h1 #{title}
      p.lead Taco hunger can strike at any moment. With TacoQuest on your BlackBerry® 10 smartphone, you'll always know where the best tacos near you are.
      p Use <a href="./sticky-footer-navbar.html">the sticky footer</a> with a fixed navbar if need be, too.</p>
    #push
  #footer
    .container
      p.muted.credit Copyright 2013 #{title}

style.css

代码语言:javascript
复制
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 -60px;
}

/* Set the fixed height of the footer here */
#push,
#footer {
  height: 60px;
}
#footer {
  background-color: #f5f5f5;
}

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



/* Custom page CSS
-------------------------------------------------- */
/* Not required for template or sticky footer method. */

.container {
  width: auto;
  max-width: 680px;
}
.container .credit {
  margin: 20px 0;
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-05-30 19:17:59

尝试将html添加到body CSS,使其高度也为100%..

代码语言:javascript
复制
html,body {
  height: 100%;
  /* The html and body elements cannot have any padding or margin. */
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16834089

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档