I create a navbar. I started to design it with mobile first method. then I start to design for bigger screen sizes. here I faced to a problem with layout. in navbar I have these elements : logo, li tags, shopping cart icon, button. I want to put logo and li to the right side, and put the shopping cart icon and button to the left. I'll show you the screen capture in mobile: here is the screen capture in mobile screen in this size, layout has no problem. but, I will show you the screen capture of bigger screen size:screen capture in bigger size the problem is that the li tags go to the left side that it shouden't be like that. it should be next to the logo. I think the problem is in the html codes. the order of the html codes are like this : logo, hamburger menu, shopping cart icon, button and then li tags. I think the problem is because of the li tags are the last elemnt. but if I change the order, I'll faced to a problem in mobile screen size. would you plz help me to solve the problem? By the way, I forgot to say I wrote it with css flex. here is the html codes:
*{
font-family: myfont;
direction: rtl;
margin:0;
padding: 0;
}
.nav-logo{
width: 70px;
cursor: pointer;
}
.hamburger-menu{
display: flex;
margin-right: 20px;
cursor: pointer;
font-size: 25px;
color: #e63946;
}
nav{
padding: 10px;
background-color: #ffffff;
background: rgba( 255, 255, 255, 0.25 );
box-shadow: 0 8px 32px 0 rgba( 31, 38, 135, 0.37 );
backdrop-filter: blur( 17.5px );
-webkit-backdrop-filter: blur( 17.5px );
border: 1px solid rgba( 255, 255, 255, 0.18 );
}
.row{
display: flex;
align-items: center;
justify-content: space-between;
}
.right{
display: flex;
justify-content: flex-start;
margin-right:30px;
}
.left{
display: flex;
justify-content: flex-end;
margin-left:30px;
}
.column{
display: flex;
justify-content: center;
flex-direction: column;
text-align: center;
cursor: pointer;
}
.nav-item{
list-style: none;
}
.nav-item a{
text-decoration: none;
color: #35357a;
line-height: 40px;
}
.nav-item a:hover{
color: #e63946;
}
.btn-login{
background-color: #e63946;
color:white;
border: none;
padding: 10px 20px;
border-radius:50px;
font-size: 15px;
cursor: pointer;
}
@media screen and (min-width: 646px) {
nav{
display: flex;
flex-direction: row;
}
.nav{
display: flex;
align-items: center;
justify-content: space-between;
flex-direction: row;
padding: 10px;
}
.navbar{
list-style: none;
display: flex;
justify-content:flex-end;
}
.column{
}
.hamburger-menu{
display: none;
cursor: pointer;
font-size: 25px;
color: #e63946;
}
.right{
display: flex;
align-items: center;
justify-content:flex-end;
}
.left{
display: flex;
align-items: center;
justify-content: flex-start;
margin-left: 20px;
}
}
<body>
<nav class="nav">
<section class="row">
<div class="right">
<div>
<img class="nav-logo" src="images/golgasht1.png"/>
</div>
<div class="hamburger-menu">
<i class="fa fa-bars"></i>
</div>
</div>
<div class="left">
<span class="cart-btn">
<i class="fas fa-shopping-cart"></i>
<span class="cart-items">0</span>
</span>
<a href = "register&login/login.php"><button class="btn btn-login px-4 ml-5">ورود </button></a>
</div>
</section>
<section class="column">
<ul class="navbar">
<li class="nav-item">
<a class="nav-link">فارس گردی</a>
</li>
<li class="nav-item">
<a href="gallery.php" class="nav-link">گالری عکس</a>
</li>
<li class="nav-item">
<a href="Vtour.php" class="nav-link">تور مجازی</a>
</li>
<li class="nav-item">
<a href="weblog.php" class="nav-link">وبلاگ</a>
</li>
</ul>
</section>
</nav>
</body>