user1760110 user1760110 - 1 month ago 11
CSS Question

How to Add Affix to Bootstrap Fixed Bottom Navbar

First of all, please be inform that I already know, we can add

utility to all kind of regular
in Bootstrap, In my case ,however, I need to add the affix to a specifically

@import url("");

<script src=""></script>
<script src=""></script>
<nav class="navbar navbar-inverse navbar-fixed-bottom">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<a class="navbar-brand" href="#">Brand</a>

<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">

<ul class="nav navbar-nav navbar-right">
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
</div><!-- /.navbar-collapse -->
</div><!-- /.container -->
<div class="container" style="height:3000px;"></div>

The reson that I would like to do this is presenting the navbar at the bottom of
on page loading and on scroll down affix it to the top.

Can you please let me know if this is doable?


You need to add CSS to handle the navbar when affix is applied. In your case, that would be changing the navbar top:0; so that it no longer is fixed to the botttom.

.affix.navbar-fixed-bottom {
    top: 0;
    height: 50px;