I am learning to use grids in a website and have a couple of problems:
I can't center the text in grid items;
If I attempt to have a gap between columns it only gets inserted between the last 2 columns.
Is it possible that they are both due to the same error? I've tried margin-auto and various align and justify settings and none helped.
.wrapper1 {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 10px;
grid-auto-rows: minmax(20px, auto);
}
.wrapper1 a {
color: white;
}
.one {
grid-column: 1 / 2;
grid-row: 1;
background-color: red;
}
.two {
grid-column: 2 / 2;
grid-row: 1;
background-color: red;
}
<div class="wrapper1">
<div class="one"><a href="/chart/world-vaccinations-map">World Vaccinations</a></div>
<div class="two"><a href="/chart/world-capita-new-cases-map">World Cases</a></div>
</div>