3
I’m looking for a way to line up divs
on the left, however, keep them divided into groups, without a group breaking the line. The code below comes close, but would like to get the result of the image.
.group {
border-width: 1px;
border-style: solid;
border-color: #008040;
overflow: inherit;
padding:5px;
float:left;
margin-left: 5px;
margin-top:5px;
}
.machine {
float: left;
border-color: red;
height: 75px;
width: 50px;
border-width: 1px;
border-style: solid;
box-sizing:border-box;
}
<div id="group1" class="group">
<div id="subDiv1" class="machine">1</div>
<div id="subDiv2" class="machine">2</div>
<div id="subDiv3" class="machine">3</div>
<div id="subDiv4" class="machine">4</div>
</div>
<div id="group2" class="group">
<div id="subDiv1" class="machine">1</div>
<div id="subDiv2" class="machine">2</div>
<div id="subDiv3" class="machine">3</div>
<div id="subDiv4" class="machine">4</div>
</div>
<div id="group3" class="group">
<div id="subDiv1" class="machine">1</div>
<div id="subDiv2" class="machine">2</div>
<div id="subDiv3" class="machine">3</div>
<div id="subDiv4" class="machine">4</div>
</div>
The code above gives me this result (CURRENT):
But I would like to get this other result (DESIRED):
It is possible?
Complicated to do this, I particularly can’t imagine a simple way to do or something ready to do, I would have to identify the "group" that exceeds the width of the screen and modify it, so it goes... Some ideas have emerged, but none of simple implementation, in case I find something, put here.
– Mathiasfc
This code comes very close to the expected result [link]https://stackoverflow.com/a/44293889/1872936
– pires