Navbars
Design responsive navigation bars that adapt to different screen sizes. Customize menus, logos, and navigation links.
Navbars | Description | Syntax |
---|---|---|
Basic | Creates default navbar | .navbar |
Inverted | Inverts the color of default navbar | .navbar-inverse |
Colored | Changes background color | .bg-* |
Right-aligned | Right aligns the navbar | .navbar-right |
Fixed | Fixes the navigation bar at the top of the webpage. | .navbar-fixed-top |
Dropdown | Makes a drop-down interface. | .dropdown |
Collapsible | Makes a collapsible navbar | .navbar-collapse |
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Navbar Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href=
"https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<script src=
"https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js">
</script>
<script src=
"https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js">
</script>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">WebsiteName</a>
</div>
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
Page 1<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Page 1.1</a></li>
<li><a href="#">Page 1.2</a></li>
<li><a href="#">Page 1.3</a></li>
</ul>
</li>
<li><a href="#">Page 2</a></li>
<li><a href="#">Page 3</a></li>
</ul>
</div>
</nav>
</body>
</html>
Bootstrap Cheat Sheet – A Basic Guide to Bootstrap
Bootstrap is a free, open-source, potent CSS framework and toolkit used to create modern and responsive websites and web applications. It is the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites. Nowadays, websites are perfect for all browsers and all sizes of screens.
Contact Us