I want to create a navbar using the CSS grid
attribute. Currently I have this
#navbar {
height: 60px;
display: grid;
justify-items: right;
padding: 20px;
background: red;
}
#navbarLinkContainer {}
a {
text-decoration: none;
margin: 0 10px;
color: white;
background: black;
}
<div id="navbar">
<div id="navbarLinkContainer">
<a href="/">Home</a>
<a href="/about">About</a>
<a href="/projects">Projects</a>
<a href="/contact">Contact</a>
<a href="/imprint">Imprint</a>
</div>
</div>
and my problem is that I don't know how to center the links vertically within the navbarLinkContainer
.
I tried to add align-items: center
and vertical-align: middle
to the navbarLinkContainer
but this didn't help. So how can I center the links within the navbar?