Greetings if this question has already been inquired about, but my search turned up nothing quite like it.
My current setup is as follows:
.main{
display: inline-flex;
flex-direction: row;
}
<div class = "main">
<div class="sub-div">1 </div>
<div class="sub-div">2 </div>
<div class="sub-div">3 </div>
<div class="sub-div">4 </div>
<div class="sub-div">5 </div>
<div class="sub-div">6 </div>
</div>
The current result shows all the divs in a single line. Is there a way to arrange them so that 3 divs are on the top row and 3 divs on the bottom row?
In addition, if the screen size decreases, how can I organize the divs to have 2 on the top row, 2 in the middle row, and 2 on the last row?
Is there a method to achieve this without modifying the HTML structure or utilizing Javascript?