I'm having an issue with my navbar that contains both an image and a menu. Everything looks good when the window is maximized, but as soon as I start to resize it, the image and menu shrink while the navbar stays the same height.
I've tried using various options like percentages, vh, vw, and more, but nothing seems to solve the problem. Here's my code:
.main-bar {
background-color: #212121;
font-size: 1.5vw;
color: #8a8a8d;
font-family: sans-serif;
display: inline-flex;
width: 100%;
}
.imgs {
margin-top: 10px;
margin-bottom: 0px;
margin-left: 25px;
margin-right: 30px;
/* width: fit-content; */
width: 700px;
height: 110px;
}
.imgs img {
width: 100%;
height: auto;
}
.menu {
width: 100%;
margin-top: 45px;
}
#login {
float: right;
margin-right: 2vw;
margin-top: -10px;
}
.menu_item {
padding: 10px;
}
.menu_item:hover,
.login:hover {
color: #E3E3E3;
cursor: pointer;
}
<div class="main-bar">
<div class="imgs">
<img src="https://i.imgur.com/SX4tC2y.png" alt="image">
</div>
<div class="menu">
<span class="menu_item">Houses</span>
<span class="menu_item">Apartments</span>
<span class="menu_item">Cars</span>
<span class="menu_item">Rents</span>
<span class="menu_item">Others</span>
<span class="menu_item" id="login">Login</span>
</div>
</div>
Any ideas on how to fix this?