

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Fix navbar to the top with Bootstrap
Set the navbar fixed to the top, add class .navbar-fixed-top to the .navbar class.
You can try to run the following code to fix navbar to the top
Example
<!DOCTYPE html> <html> <head> <title>Bootstrap Example</title> <link href = "/bootstrap/css/bootstrap.min.css" rel = "stylesheet"> <script src = "/scripts/jquery.min.js"></script> <script src = "/bootstrap/js/bootstrap.min.js"></script> </head> <body> <nav class = "navbar navbar-default navbar-fixed-top" role = "navigation" style="background: red;"> <div class = "navbar-header"> <a class = "navbar-brand" href = "#">Modes of Transport</a> </div> <div> <ul class = "nav navbar-nav"> <li class = "active"><a href = "#">Air Transport</a></li> <li><a href = "#">Water Transport</a></li> </ul> </div> </nav> </body> </html>
- Related Questions & Answers
- Fix navbar to the bottom of the page with Bootstrap
- Bootstrap navbar-static-top class
- Usage of Bootstrap navbar-fixed-top class
- Create a navbar scrolling with the page in Bootstrap
- Bootstrap navbar-inverse class
- Bootstrap navbar-default class
- Create Default Bootstrap Navbar
- Add responsive features to Bootstrap navbar
- Create Inverted Navbar in Bootstrap
- Add buttons in Bootstrap Navbar
- Usage of Bootstrap navbar-form class
- Usage of Bootstrap navbar-btn class
- Usage of Bootstrap navbar-text class
- Wrap Strings of Text in Bootstrap Navbar
- Usage of Bootstrap navbar-fixed-bottom class
Advertisements