I am working on a div that has multiple children inside. To achieve a horizontal layout, I need to set a width on the parent div so that the content flows from left to right. Instead of having all items in one row, I want them to be split into two rows. This means I will have to calculate the total width and then divide it by 2 to wrap the items onto another line.
Since the number of children is dynamic, using a fixed CSS value is not suitable for this scenario.
The structure of the markup will resemble this:
<div id="container">
<figure>1</figure>
<figure>2</figure>
<figure>4</figure>
<figure>5</figure>
<figure>6</figure>
</div>
I would really appreciate assistance with this issue. While I have managed to determine the dimensions of a single element in the past, I am struggling to do it for a group.
Thank you in advance, Steve