I have a variable number div that should appear on two lines, as shown below.
[1] [3] [5] [7]
[2] [4] [6] ...
I looked at the property column-count, but this is not exactly what I need, since it fixes the number of columns, whereas in my case it should be dynamic. (what I need would be a similar property of the count string, which apparently does not exist).
Is there a pure CSS solution, or should I make div containers for each group of two vertical divs?
Thank,
Edit: Here is a simplified code of my case. In fact, How do I set a property heightin my div container, should shared articles be stacked by no more than 2? Now they are overflowing the container.
<html>
<head>
<link rel="stylesheet" type="text/css" href="test.css">
</head>
<body>
<div class="container">
<div class="article">A</div>
<div class="article">B</div>
<div class="article">C</div>
<div class="article">D</div>
<div class="article">E</div>
</div>
</body>
</html>
and CSS
.article {
width:50px;
height:50px;
border:1px gray dashed;
margin:1px;
}
.container {
height:110px;
max-height:110px;
}
divs .