It’s My code navbar
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.3/js/bootstrap.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css" rel="stylesheet" />
<body class="bg-dark">
<nav class="navbar navbar-expand-lg navbar-dark ">
<div class="container">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse " id="navbarText">
<ul class="navbar-nav mr-auto" style="
margin-right: 18%!important;
margin-left: 8%;
">
<li class="nav-item">
<a class="nav-link" href="#">Beranda</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Produk</a>
</li>
</ul>
<ul class="navbar-nav mr-auto">
<a class="navbar-brand" href="#">
<img src="http://byhers.id/wp-content/uploads/2020/09/Logo-BYHERS-2.png" height="100" alt="mdb logo">
</a>
</ul>
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="#">Tentang Kami</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Kontak</a>
</li>
</ul>
</div>
</div>
</nav>
the result of the codingan looks like this picture
picture
but I want the result like this image
I want the result like this image
Please help me to solve this problem thank you.
2
Answers
Add more CSS and make changes according to your need.
<ul>
. One will be visible on mobile screen and other on desktop.Add your media queries in css.
Full Code : https://codesandbox.io/s/optimistic-meadow-37ofm?file=/index.html