Navbar offset bug fix


Design Updates

Post #335

EN Outdated

Navbar offset bug fix

Wednesday, 29 September 2021 13:06:02 by Khodok

1 min read

So now my navbar is fixed

This sadly isn’t true anymore.

What’s new

  • Nothing really.

What changed

  • The navbar doesn’t have an offset anymore, it was really annoying to deal with.
Template to use in the future
HTML
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<nav class="navbar navbar-expand-lg navbar-dark navbar-static-top shadow" aria-label="Main navigation">
    <div class="container-fluid">
        <div class="d-inline-block"><a class="navbar-brand me-0" href="#">Khodok's</a> <a class="navbar-brand text-muted" href="#">{{ app_title }}</a></div>
        <button class="navbar-toggler p-0 border-0" type="button" id="top-navbar-collapse" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>

        <div class="navbar-collapse offcanvas-collapse" data-bs-scroll="false" id="top-navbar">
            <div class="d-block d-lg-none">
                ...
            </div>
            <ul class="navbar-nav me-auto mb-2 mb-lg-0 d-none d-md-flex">
                <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle" href="#create_dropdown" id="create_dropdown" data-bs-toggle="dropdown" aria-expanded="false">Create</a>
                    <ul class="dropdown-menu dropdown-menu-dark" aria-labelledby="create_dropdown">
                        <li><a class="dropdown-item" href="#">New Post</a></li>
                        <li><a class="dropdown-item" href="#">New Series</a></li>
                        <li><a class="dropdown-item" href="#">New Category</a></li>
                    </ul>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#">Log in</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#">Sign up</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#">Log in with Google</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#">Log in with Discord</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#">Log in with Github</a>
                </li>
            </ul>
        </div>
    </div>
</nav>

<div class="nav-scroller shadow mb-2">
    <nav class="nav nav-underline d-flex justify-content-between">
        <li><a class="nav-link" href="#">Home</a></li>
        <li><a class="nav-link" href="#">Profile</a></li>
        <li><a class="nav-link" href="#">I Like Trains</a></li>
    </nav>
</div>

twbs/bootstrap#35007

Comments

Please Log in to leave a comment.


This post has 0 comments.