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/

相关文章:

angularjs - ui-router View 在 Controller 中找不到方法

html - Bootstrap 图像/按钮/图像

css - Bootstrap 网格系统有条件地 flex col 宽度

html - 背景顶部的种类(如边框顶部)

列的 CSS 格式化上下文

angularjs - ng-repeat 用于 3 级以上的深度层次结构

javascript - 什么是真正的单元测试?

php - Twitter bootstrap 总是相同的内容

javascript - 将 span 的额外文本换行到下一行

jQuery 背景动画初始不透明度仅在 IE 中错误