Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Here is my code :

<nav class="navbar navbar-expand-sm  navbar-dark  ">
    <div class="container-fluid">

        <a class="navbar-brand" href="#">LOREM IPSUM</a>

        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
            <span class="navbar-toggler-icon"></span>
        </button>

        <div class="collapse navbar-collapse" id="collapsibleNavbar">
            <ul class="navbar-nav  ml-auto">
                <p class="navbar-text">lorem Ipsum Dolor</p>
                <li class="nav-item ">
                    <a class="nav-link" href="#">LOREM</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#">IPSUM</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#">DOLOR</a>
                </li>

            </ul>
        </div>
    </div>
</nav>

The result produced by this: enter image description here

How to change line after "lorem ipsum dolor" and show my all nav links(in same line) in separate line , I have tried display:block but it is not working. Any help will be appreciated !


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
315 views
Welcome To Ask or Share your Answers For Others

1 Answer

To display nav links in separate line and create a vertical navbar remove .navbar-expand-sm class from nav.

<nav class="navbar navbar-dark">
    <div class="container-fluid">

        <a class="navbar-brand" href="#">LOREM IPSUM</a>

        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
            <span class="navbar-toggler-icon"></span>
        </button>

        <div class="collapse navbar-collapse" id="collapsibleNavbar">
            <ul class="navbar-nav  ml-auto">
                <p class="navbar-text">lorem Ipsum Dolor</p>
                <li class="nav-item ">
                    <a class="nav-link" href="#">LOREM</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#">IPSUM</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#">DOLOR</a>
                </li>

            </ul>
        </div>
    </div>
</nav>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...