Sample Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
<html>
<head>
...
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
...
</head>
<body>
<nav class="navbar navbar-expand-lg bg-body-tertiary bg-dark fixed-top" data-bs-theme="dark">
<div class="container-fluid">
...
</div>
</nav>
<div style="padding-top: 3.5rem;padding-bottom: 2.5rem" class="container">
...
</div>
<nav class="navbar navbar-expand-lg bg-body-tertiary bg-dark fixed-bottom" data-bs-theme="dark">
<div class="container-fluid">
...
</div>
</nav>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN" crossorigin="anonymous"></script>
<script src="/js/button.js"></script>
</body>
</html>
|
Follow the quick-start
html configuration
- add the
css at the head tag
- add the
javascript at the bottom of body tag, ensure the javascript is enabled correctly without problem causing for missing item or elements
The top menu supposed to be on fixed on top and bottom of the page without afecting by scrolling. The container can be achieved by add bootstrap class fixed-top(for bootstrap version before 5, use navbar-fixed-top) or fixed-bottom(for bootstrap version before 5, use navbar-fixed-top)
Since the middle container is covered by the top and / or bottom menu, the container needed to define a padding for preventing overlay with the top and / or bottom menu.
e.g.
1
2
3
|
<div style="padding-top: 3.5rem;padding-bottom: 2.5rem" class="container">
...
</div>
|
Ref. Link