I'm making a press page on a website, and I have the headlines/articles set in rectangles using
.press-blocks{
column-count: 4;
column-gap: 2em;
padding-left: 10%;
padding-right: 10%;
}
.press-item{
display: inline-block;
margin: 0 0 5em;
width: 100%;
text-align: justify;
}
The whole "press" section area of the page is in one big press-blocks
section, and each individual article is in its own press-item
. This way, when a new article is written I can just place it at the beginning of the page and all the articles will be in chronological order. However, the chronological order is top to bottom, left to right, like this:
1 5 9 13
2 6 10 14
3 7 11 15
4 8 12 16
Is there a way to change it to left to right, top to bottom?
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
I looked at the W3Schools tutorial for display: inline-block
, and theirs is horizontal, but the difference is they don't have a set number of columns. I want this to always have exactly 4 columns, and to just extend further downwards when I add new ones, like it does now. I also want to maintain the vertical distance between items.
Imagine these rectangles are all evenly spaced and have the same distance between them both horizontally and vertically.