I attempted to utilize the flex property and justify content, but unfortunately that did not yield the desired result. I experimented with the code provided below.
The goal is to create a website layout with a logo at the top and a navigation bar directly underneath, as depicted in the image linked here: view site preview
<header class="top-part">
<div class="logo">
<img class="logo" src="images/logo.png" height=100px width="237px" >
</div>
<nav class="navbar navbar-expand-lg navbar-light bg-light ">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavDropdown">
<ul class="navbar-nav ">
<li >
<a class="nav-link" id="home"href="#">link 1</a>
</li>
<li class="nav-item">
<a class="nav-link" id="cart" href="#">link 2</a>
</li>
<li class="nav-item">
<a class="nav-link" id="contact"href="#">link 3</a>
</li>
</ul>
</div>
</nav>
</header>
</head>
css :
@media screen and (min-width:777px){
.nav-link {
padding:18px 0;
min-width:120px;
}
.navbar {
padding: 0
}
}
.header{
position:sticky ;
top: 0;
}