I'm trying to use CSS Grid as a 2d alternative to fill the space for a small test blog I am creating. I've run into a small issue regarding positioning.
Firstly, as it's a blog, I'm not too sure how long the content is going to be inside the articles. Therefore I can't use a set positioning to modify the layout.
My current view is:
However, I would like the view to look like:
Currently, my code is structured as:
CSS
.articles {
margin: 20px;
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 1em;
}
article {
align-self: start;
}
HTML
<div class="articles">
<article>lorem ipsum...</article>
<article>lorem ipsum...</article>
<article>lorem ipsum...</article>
</div>
It seems the align-self is working as it should by removing the empty content because of the larger (Second) paragraph. However the third paragraph is staying in its current static position rather than moving up into the now blank, position where align-self: stretch
would have been.
I'm not too sure what I can try to fix this issue.