相关疑难解决方法(0)

使用jquery设置di​​v高度(拉伸div高度)

我有3个带有ID的div header,contentfooter.页眉和页脚具有固定的高度,它们的样式可以在顶部和底部浮动.我想content用jquery自动计算中间高度.我怎么能这样做?

#header {
    height: 35px;
    width: 100%;
    position: absolute;
    top: 0px;
    z-index: 2;
}
#footer {
    height: 35px;
    width: 100%;
    position: absolute;
    bottom: 0px;
    z-index: 2;
}
Run Code Online (Sandbox Code Playgroud)

提前致谢...:)

blasteralfred

css jquery css3

47
推荐指数
4
解决办法
22万
查看次数

如何使Bootstrap粘性页脚内容达到整页高度?

我正在使用Boostrap示例使用CSS为网站创建粘性页脚,这一切都很好,页面调整大小后页脚底部保留在页面底部.在许多页面上,我有内容需要显示几乎整页,禁止页脚.因此,页面的内容部分需要设置为100%高度,因此其内容又可以调整为全高.

这是一个演示问题的JSFiddle.

我们怎样才能让绿色容器达到全高,所以它触及顶部的页面顶部和底部的页脚顶部?

谢谢!

<div id="wrap">
    <!-- Begin page content -->
    <div class="container">
        <div class="page-header">
            <h1>Sticky footer</h1>

        </div>
        <p class="lead">This is the sticky footer template taken from the Bootstrap web site.</p>
        <p class="lead">How can we make this green .container div the full height of its parent #wrap div?</p>
    </div>
    <div id="push"></div>
</div>
<div id="footer">
    <div class="container"></div>
</div>
Run Code Online (Sandbox Code Playgroud)
#wrap .container {
    background-color: lightgreen;
}
/* Sticky footer styles  */
html, body {
    height: 100%;
    /* The html and body elements cannot …
Run Code Online (Sandbox Code Playgroud)

html css layout sticky-footer twitter-bootstrap

5
推荐指数
1
解决办法
8760
查看次数

标签 统计

css ×2

css3 ×1

html ×1

jquery ×1

layout ×1

sticky-footer ×1

twitter-bootstrap ×1