css - 内容 div 内的页脚( Bootstrap )

标签 css twitter-bootstrap

enter image description here

我的页脚卡在内容 div 中

代码 https://jsfiddle.net/rfh7jomp/

试过 position:relative;,但在较小的页面中它不会在底部。

如果重要,请使用 Bootstrap 。

HTML 代码:

<div class="footer">
    <div class="container">
         <p>footer text</p>
    </div>
</div>

CSS 代码:

.footer
{
    position: absolute;
    clear:both;
    bottom: 0;
    width: 100%;
    height: 30px;
    padding:3px;
    text-align:center;
    background-color:rgba(111, 111, 111, 0.65);
    border-top:1px solid #bbb;
    color:#F3F3F3;
}

最佳答案

如果您使用的是 Bootstrap 3.2.0,只需添加类 navbar-fixed-bottom给你的footer类,并删除 position: absolute;来自 .footer

演示--> https://jsfiddle.net/rfh7jomp/2/

关于css - 内容 div 内的页脚( Bootstrap ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32765461/

相关文章:

javascript - 如何弹出相对于div的内容

html - Bootstrap 容器宽度以匹配网页大小

php - 通过 Bootstrap 模态渲染 View

javascript - 如何使用 Jquery 绑定(bind)菜单和子菜单应用 css?

css - 保持响应图像相同的高度并在图像内居中

jquery - 我需要一个多级移动导航栏来 Bootstrap NO HOVER

twitter-bootstrap - Bootstrap 3.0 scrollspy 响应式偏移

twitter-bootstrap - Twitter Bootstrap 工具提示不适用于全日历中的事件

html - 不能使用背景图像 html/css

javascript - 加载的 div Accordion 在窗口而不是容器 div 中打开