content logo

Bootstrap Headers:

Bootstrap Header with Hover Effect

Today, a lot of people use their mobile phones to browse and enter websites. This led to web designers optimizing their websites with designs for mobile web. One of the site elements that was optimized was the header. Nowadays, a lot of websites use the toggle navigation menu format which is meant mostly for mobile phones. In this format, all the items are displayed in a list and can be collapsed behind a toggle button. this is a great feature as it allows for a nice user experience in both large and small screen sizes. Upon clicking the three-line toggle icon, a vertical drop-down menu appears with the navigation links.

With that said, you should know that aesthetics is just as important as functionality in a website. Your header has the potential of increasing your daily traffic by a large amount. The animating navbar code below features a toggle menu header suitable for both desktop browsers and mobile phones. It has a mesmerising dark theme with nice colours. The Bootstrap navbar animation hover effect works in a way that your mouse cursor makes a red indication bar appear over the selected item in the list. This Bootstrap dynamic navbar is perfect for any website and is available for free. So, don’t hesitate and scroll down to use it right now.

#

Animating Navbar Code

#

Bootstrap Navbar Animation

#

Bootstrap Dynamic Navbar

<!-- This script got from frontendfreecode.com -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">Animated Bootstrap Nav</a>
        </div>

        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li><a href="#">About</a><span class="hover"></span></li>
                <li><a href="#">Services</a><span class="hover"></span></li>
                <li><a href="#">Portfolio</a><span class="hover"></span></li>
                <li><a href="#">Blog</a><span class="hover"></span></li>
                <li><a href="#">Contact</a><span class="hover"></span></li>
            </ul>
        </div>
    </div>
</nav><a style="font-size: 8pt; text-decoration: none" target="_blank" href="http://frontendfreecode.com">Free Frontend</a>
                                                                            
body {
    background: #192226 !important;
}

.navbar-inverse {
    background: #222B31 !important;
    border-bottom: 4px solid #EE445F !important;
}

.navbar-brand {
    font: 12px Lato !important;
    text-transform: uppercase;
    color: #FFF !important;
    letter-spacing: 2px;
    margin-top: 2px;
}

.nav {
    margin-bottom: 0px;
}

    .nav a {
        font: 500 11px Lato;
        letter-spacing: 2px;
        padding: 16px !important;
        color: #a3bfc6 !important;
        text-transform: uppercase;
        position: relative;
        z-index: 1000;
    }

        .nav a:hover {
            color: #FFF !important;
        }

    .nav li {
        position: relative;
    }

.navbar-inverse .navbar-toggle {
    border: none;
}

.navbar-collapse {
    box-shadow: none !important;
    border: none !important;
}

.navbar-inverse .navbar-toggle:hover {
    background: transparent !important;
}

.navbar-inverse .navbar-toggle:focus {
    background: transparent !important;
}

.navbar-inverse .navbar-toggle:active {
    background: transparent !important;
}

.icon-bar {
    background: #a3bfc6 !important;
}

.hover {
    display: block;
    position: absolute;
    width: 0%;
    height: 100%;
    top: 0px;
    left: 0px;
    background: #EE445F !important;
    z-index: 0;
    opacity: 0;
}

@media (max-width: 767px) {
    .nav {
        padding-bottom: 20px;
    }

        .nav a {
            padding: 12px !important;
        }
}

@media (max-width: 480px) {
    .nav {
        padding-bottom: 20px;
    }
}
$("li").hover(
    function () {
        $(this).find("span").stop().animate({
            width: "100%",
            opacity: "1",
        }, 400, function () {
        })
    }, function () {
        $(this).find("span").stop().animate({
            width: "0%",
            opacity: "0",
        }, 400, function () {
        })
    }
);
<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css'>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Lato:100,300,400,700,900' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<script src='https://code.jquery.com/jquery-2.2.4.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/js/bootstrap.min.js'></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- This script got from frontendfreecode.com -->

<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css'>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Lato:100,300,400,700,900' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<script src='https://code.jquery.com/jquery-2.2.4.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/js/bootstrap.min.js'></script>
<style>
body {
    background: #192226 !important;
}

.navbar-inverse {
    background: #222B31 !important;
    border-bottom: 4px solid #EE445F !important;
}

.navbar-brand {
    font: 12px Lato !important;
    text-transform: uppercase;
    color: #FFF !important;
    letter-spacing: 2px;
    margin-top: 2px;
}

.nav {
    margin-bottom: 0px;
}

    .nav a {
        font: 500 11px Lato;
        letter-spacing: 2px;
        padding: 16px !important;
        color: #a3bfc6 !important;
        text-transform: uppercase;
        position: relative;
        z-index: 1000;
    }

        .nav a:hover {
            color: #FFF !important;
        }

    .nav li {
        position: relative;
    }

.navbar-inverse .navbar-toggle {
    border: none;
}

.navbar-collapse {
    box-shadow: none !important;
    border: none !important;
}

.navbar-inverse .navbar-toggle:hover {
    background: transparent !important;
}

.navbar-inverse .navbar-toggle:focus {
    background: transparent !important;
}

.navbar-inverse .navbar-toggle:active {
    background: transparent !important;
}

.icon-bar {
    background: #a3bfc6 !important;
}

.hover {
    display: block;
    position: absolute;
    width: 0%;
    height: 100%;
    top: 0px;
    left: 0px;
    background: #EE445F !important;
    z-index: 0;
    opacity: 0;
}

@media (max-width: 767px) {
    .nav {
        padding-bottom: 20px;
    }

        .nav a {
            padding: 12px !important;
        }
}

@media (max-width: 480px) {
    .nav {
        padding-bottom: 20px;
    }
}
</style>

</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">Animated Bootstrap Nav</a>
        </div>

        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li><a href="#">About</a><span class="hover"></span></li>
                <li><a href="#">Services</a><span class="hover"></span></li>
                <li><a href="#">Portfolio</a><span class="hover"></span></li>
                <li><a href="#">Blog</a><span class="hover"></span></li>
                <li><a href="#">Contact</a><span class="hover"></span></li>
            </ul>
        </div>
    </div>
</nav><div id="bcl"><a style="font-size:8pt;text-decoration:none;" href="http://www.devanswer.com">Free Frontend</a></div>
<script>
$("li").hover(
    function () {
        $(this).find("span").stop().animate({
            width: "100%",
            opacity: "1",
        }, 400, function () {
        })
    }, function () {
        $(this).find("span").stop().animate({
            width: "0%",
            opacity: "0",
        }, 400, function () {
        })
    }
);
</script>

</body>
</html>
Preview