在Bootstrap中修复了页脚 [英] Fixed footer in Bootstrap

查看:106
本文介绍了在Bootstrap中修复了页脚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了 Bootstrap ,我想知道,如何修复底部的页脚而不用它如果内容滚动,它会从页面消失吗?

I'm trying out Bootstrap and I was wondering, how I can fix the footer on the bottom without having it disappear from the page if the content is scrolled?

推荐答案

要获取粘贴到视口底部的页脚,像这样的固定位置:

To get a footer that sticks to the bottom of your viewport, give it a fixed position like this:

footer {
    position: fixed;
    height: 100px;
    bottom: 0;
    width: 100%;
}

Bootstrap将这个CSS包含在Navbar> Placement部分中,类固定底。只需将此类添加到页脚元素即可:

Bootstrap includes this CSS in the Navbar > Placement section with the class fixed-bottom. Just add this class to your footer element:

<footer class="fixed-bottom">

Bootstrap文档: http://v4-alpha.getbootstrap.com/components/navbar/#placement

Bootstrap docs: http://v4-alpha.getbootstrap.com/components/navbar/#placement

这篇关于在Bootstrap中修复了页脚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆