I am currently have some troubles to add a vertical line between grid items. My current solution has empty spaces between the lines and I cannot work with borders, because a border will directly "glue" on the item and not in the middle of two items.
This code above currently looks like this:
But it should look like this:
#grid-container {
display: grid;
grid-template-columns: 1fr 1fr;
grid-gap: 16px;
}
.grid-item {
height: 20px;
background-color: red;
position: relative;
}
.grid-item::after {
content: "";
position: absolute;
height: 100%;
width: 2px;
background: grey;
right: -9px
}
<div id="grid-container">
<div class="grid-item"></div>
<div class="grid-item"></div>
<div class="grid-item"></div>
<div class="grid-item"></div>
<div class="grid-item"></div>
<div class="grid-item"></div>
</div>
flex
if that is an option here. – Rustcoloreddiv
s. – Rustcolored