css - AngularJS 中的粘性 Bootstrap 页脚

标签 css angularjs twitter-bootstrap

已解决。我使用这个解决方案:http://mystrd.at/modern-clean-css-sticky-footer/

===

我正在创建一个 social media share count app使用 AngularJS。在数据出现之前,用户需要输入一个 URL 并点击“Kira”按钮。

数据将与其他元素一起显示,例如屏幕截图和下方的一些文本。

我试图让我的页脚具有粘性,但它在移动 View 中不起作用。

桌面 View :

enter image description here

移动 View :

enter image description here

这是我的页 footer 分的 index.html:

<div class="footer">
        <div class="panel-footer text-center">
            <p class="tcenter"><small>Dibangunkan oleh <a href="http://facebook.com/handyplast" target="_blank">Zulhilmi Zainudin</a> // Teh tarik ditaja oleh <a href="http://www.binablogdotcomsendiri.com/blog/?utm_source=social-signal-checker&utm_medium=social-signal-checker-tool&utm_campaign=social-signal-checker" target="_blank">Bina Blog Dot Com Sendiri</a> &#128522;</small></p>
        </div>
    </div>

这是我的页 footer 分的 style.css 文件:

.footer {
    position: absolute;
    bottom: -100px;
    width: 100%;
    /* Set the fixed height of the footer here */

    height: 50px;
    background-color: #f5f5f5;
}

我的问题: 如何使页脚在两种 View (桌面和移动设备)中保持粘性?

最佳答案

应该做这样的事情

标记

<footer class="footer">
  <div class="container">
    <p class="text-muted">Place sticky footer content here.</p>
  </div>
</footer>

CSS

.footer {
position: absolute;
bottom: 0;
width: 100%;
height: 60px;
background-color: #f5f5f5;
}

如我的评论所述,您需要使用 Media-Query 更改较小屏幕上的样式。

@media screen and (max-width: 360px) {
.footer {
    //Mobile footer style here
}
}

阅读有关媒体查询的更多信息 here

Reference

关于css - AngularJS 中的粘性 Bootstrap 页脚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30733133/

相关文章:

jquery - 如何使用JQuery识别CSS 'text-decoration'

angularjs - 对 AngularJS ng-repeat 语法感到困惑

javascript - AngularJS 无法使用哈希跳转到 anchor

javascript - 类型错误 : Cannot read property &#39;location&#39; of undefined

html - 调整 bootstrap div 浏览器大小时如何摆脱空间?

css - 在 Bootstrap 3 中设置 'select' 元素的高度?

css - 为什么使用 bootstrap 时下拉框不会出现在正确的位置?

css - 根据 body 类别更改所有变量值

css - 表单内容宽度问题

javascript - 强制下拉