Currently, I am developing a blog where search results for articles will be displayed within divs. The design of the website is completely horizontal, meaning that articles scroll horizontally.
Creating a single line of divs is straightforward, but it's not what I have in mind. To better illustrate my idea, let me provide a diagram of how I envision the div layout:
______________ ______________ ______________
| Div 1 | | Div 4 | | Div 7 |
|______________| |______________| |______________|
______________ ______________ ______________
| Div 2 | | Div 5 | | Div 8 |
|______________| |______________| |______________|
______________ ______________
| Div 3 | | Div 6 |
|______________| |______________|
However, if the height of the window is increased, allowing more vertical space, the layout should adjust accordingly:
______________ ______________
| Div 1 | | Div 5 |
|______________| |______________|
______________ ______________
| Div 2 | | Div 6 |
|______________| |______________|
______________ ______________
| Div 3 | | Div 7 |
|______________| |______________|
______________ ______________
| Div 4 | | Div 8 |
|_______________| |______________|
I refer to this as horizontal wrapping, where divs maximize available vertical space before moving on to a new column.
Initially, I hoped to achieve this effect using purely HTML and CSS, but now I suspect that achieving it may require some JavaScript.