As you can see, I have divided .content
div into five equal columns. I wanted to make navigation (nav
) be in the center of the last two of the columns.
I specified that its location should be on 4 / 5
and also added justify-self: center
for centering, but apparently, the element is just stuck on the 4th column. I also inspected it and It doesn't leave one column no matter what. How do I fix this?
.content {
height: 100vh;
display: grid;
grid-template-columns: 20% 20% 20% 20% 20%;
grid-template-rows: 10% 10% 10% 10% 10% 10% 10% 10% 10% 10%;
}
.content nav {
grid-column: 4 / 5;
grid-row: 1;
align-self: center;
justify-self: center;
}
.content nav a {
margin: 0cm 0.5cm 0cm 0.5cm;
}
<div class="content">
<nav>
<a href="#">Text #1</a>
<a href="#">Text #2s</a>
<a href="#">Text #3</a>
<a href="#">Text #4</a>
</nav>
</div>