I am facing a challenge in creating a navbar with two regions split by white space. I attempted to use float:right
and justify-content: space-between
, but it doesn't seem to work as expected. My goal is to have site-header-right
on the right side and site-header-navbar
on the left.
I considered adding margins between the two divs, but that solution felt like a temporary fix that might lead to responsiveness issues later on. (If I'm mistaken about this, please correct me š).
.site-header-navbar {
display: inline-block;
margin: auto;
}
nav ul {
display: inline-block;
list-style-type: none;
}
nav ul li {
display: inline-block;
margin-right: 20px;
}
nav ul li .sale {
color: #a62120;
}
.site-header-right {
display: inline-block;
margin: auto;
}
.small-container {
display: inline-block;
}
.search-btn {
display: inline-block;
margin-right: 20px;
text-transform: uppercase;
font-family: Arial, Helvetica, sans-serif;
color: #555;
font-size: 12px;
line-height: 1.1;
letter-spacing: 1px;
font-weight: 500;
}
.site-header-right a {
display: inline-block;
margin-right: 20px;
}
.site-navigation {
display: flex;
}
<html>
<body>
<div class="site-header-masthead">
<div class="container">
<div class="row">
<div class="col-12 navbar">
<div class="menu-hamburger"></div>
<div class="toast-logo">
<a href="index.html"><img src="images/logo.jpeg" width="110px"></a>
</div>
<div class="site-navigation">
<nav class="site-header-navbar">
<ul class="site-nav">
<li><a href="https://us.toa.st/collections/women">Women</a></li>
<li><a href="https://us.toa.st/collections/men">Men</a></li>
<li><a href="https://us.toa.st/collections/house-home">House&Home</a></li>
<li><a href="https://us.toa.st/collections/sale" class="sale">Sale</a></li>
<li><a href="https://us.toa.st/pages/events">Events</a></li>
<li><a href="https://us.toa.st/blogs/magazine">Magazine</a></li>
<li><a href="https://us.toa.st/pages/about-us">Our Approach</a></li>
</ul>
</nav>
<div class="site-header-right">
<div class="small-container">
<button class="search-btn">Search</button>
<a href="#" class="site-header-wishlist">
<span>Saved</span>
<span>(0)</span>
</a>
<a href="#" class="site-header-account">Account</a>
<a href="#" class="site-header-cart">
<span>Bag</span>
<span>(0)</span>
</a>
</div>
</div>
</body>
</html>