Learning CSS can be a challenge, but I recently made progress by using display flex to create a navigation bar. However, I encountered an issue where the background image for the navbar doesn't align with the left side of the screen and results in unwanted scroll bars. Here is the code snippet:
.container {
width: 100%;
background-color: rgba(79, 79, 79, 0.13);
box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 50px;
}
nav ul li {
display: inline-block;
margin: 0 15px;
}
.logo {
width: 150px;
height: auto;
cursor: pointer;
}
.bg-img {
margin: 0;
opacity: 0.9;
position: absolute;
z-index: -1;
justify-content: center;
}
<div class="container">
<img src="files/images/logo.png" alt="LOGO" class="logo">
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/">Second</a></li>
<li><a href="/">Third</a></li>
</ul>
</nav>
<img src="files/images/top-bg.jpg" alt="bg" class="bg-img">
</div>