I’m new to coding so the answer is probably obvious. I have all the items including the logo under however the logo hides behind the navigation bar no matter what I do. I’m trying to make the navigation bar and the logo move down the page as the user scrolls. As it sits that works but its just getting the logo inline with it all.
img {
width: 80px;
display: inline-flex;
}
ul{
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #5c4033;
position: fixed;
top: 0;
width: 100%
}
li {
float: left;
}
li a {
display: inline-flex;
padding: 20px;
text-align: center;
padding: 14px 16ox;
color: #ffffff;
}
li a:hover {
background-color: #c4a484;
}
nav {
display:inline-flex;
z-index:1;
position:fixed;
top:25px;
width:fit-content;
height:44px;
list-style-type:none;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
<nav>
<img src="Images/lilac-valley-logo.png" alt="Lilac Valley Logo">
<ul id="navItems">
<li><a href="default.asp">Home</a></li>
<li><a href="About.asp">About</a></li>
<li><a href="Gallery.asp">Gallery</a></li>
<li><a href="Contact.asp">Contact</a></li>
<li><a href="Booking.asp">Booking</a></li>
</ul>
</nav>
Half the css probably isn’t needed. but basically as it sits this code creates a navigation bar but the logo is hidden behind it. I tried deleting the img portion but that just makes the logo massive. Tried changing width on both images and nav but that either changed the size of the image or shortened the nav bar.
2
Answers
this is a standart nav bar based on your code
You need just to arrange your style code you can try this :
HTML: