My navbar has an issue where the listed items do not fill the entire height of the navbar. I have tried adjusting padding and margin, but it doesn't seem to be affecting the layout. Any suggestions would be greatly appreciated. Thank you.
#navbar {
display: flex;
justify-content: flex-end;
width: 100%;
top: 0;
left: 0;
padding: 0;
position: fixed;
background-color: slategray;
}
#nav-list {
display: flex;
margin-right: 5rem;
list-style: none;
}
#nav-list a {
display: block;
padding: 1rem;
color: white;
font-size: 1.5rem;
text-decoration: none;
border: 1px solid black;
}
#nav-list a:hover {
background: grey;
}
<nav id="navbar">
<ul id="nav-list">
<li><a>item1</a></li>
<li><a>item2</a></li>
<li><a>item3</a></li>
</ul>
</nav>
UPDATE: Thank you everyone for the quick responses. It turns out that the issue was with the margin, even though I had experimented with it before. I am grateful for all the solutions provided and for learning about the default behavior of ul margins!