I am trying to use CSS Grid to align items which will be part of a navbar.
You can see it here: https://jsfiddle.net/nodpekar/82p0x4hw/5/
I don't know why the below code does not align the items in class navbar-items
in center.
body,
html {
height: 100%;
margin: 0;
}
#navbar {
display: grid;
grid-template-columns: repeat(3, 1fr);
}
.navbar-items {
display: grid;
align-items: center;
justify-content: center;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.1/css/all.min.css" rel="stylesheet"/>
<div id="navbar">
<div class="navbar-items">
<p>Projects</p>
<span><i class="fas fa-angle-down"></i></span>
</div>
<div class="navbar-items">
<p>Blog</p>
<span><i class="fas fa-angle-down"></i></span>
</div>
<div class="navbar-items">
<p>Resume</p>
<span><i class="fas fa-angle-down"></i></span>
</div>
</div>