bootstrap justify-content-between 在 header 中不工作

bootstrap justify-content-between not working in header

我正在尝试制作一个 header,当在 PC 上时是普通导航,而当在较小的设备(如 phone 等)上时变成汉堡导航。现在汉堡导航正在工作(只需要这样做,这样每当我使用较小的设备时它就会显示,而另一个会显示 d-none)

现在问题出在我的正常导航上,每当我尝试调整两者之间的内容以使链接 space 均匀显示时,它只是想工作,我得到默认块显示

这是需要修复的代码:

<div class="header">
        <nav class="navbar navbar-light">
            <div class="burger-nav d-none">
                <a class="navbar-brand" href="#">
                    <h1 id="logo"><span class="h1yellow">Crypto</span><span class="h1white">Mania</span></h1>
                </a>
                <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                </button>
                <div class="collapse navbar-collapse" id="navbarNav">
                    <ul class="navbar-nav">
                        <li class="nav-item active">
                            <a class="nav-link" href="#">Login<span class="sr-only">(current)</span></a>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="normal-nav d-flex justify-content-between"> <!-- this part doesnt work -->
                <ul class="navbar-nav">
                    <li class="nav-item active ">
                        <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
                    </li>
                    <li class="nav-item active">
                        <h1 id="logo"><span class="h1yellow">Crypto</span><span class="h1white">Mania</span></h1>
                    </li>
                    <li class="nav-item active ">
                        <a class="nav-link" href="#">Login <span class="sr-only">(current)</span></a>
                    </li>
                </ul>
            </div>
        </nav>
    </div>

这是整个导航,但我对问题所在做了一些评论。如果有人看到任何东西请告诉我。

<div class="header">
        <nav class="navbar-light">
            <div class="burger-nav d-none">
                <a class="navbar-brand" href="#">
                    <h1 id="logo"><span class="h1yellow">Crypto</span><span class="h1white">Mania</span></h1>
                </a>
                <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                </button>
                <div class="collapse navbar-collapse" id="navbarNav">
                    <ul class="navbar-nav">
                        <li class="nav-item active">
                            <a class="nav-link" href="#">Login<span class="sr-only">(current)</span></a>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="I removed this classes "> <!-- this part doesnt work -->
                <ul class="d-flex justify-content-between">
                    <li class="nav-item active ">
                        <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
                    </li>
                    <li class="nav-item active">
                        <h1 id="logo"><span class="h1yellow">Crypto</span><span class="h1white">Mania</span></h1>
                    </li>
                    <li class="nav-item active ">
                        <a class="nav-link" href="#">Login <span class="sr-only">(current)</span></a>
                    </li>
                </ul>
            </div>
        </nav>
    </div>

请试试这个代码。