I created this HTML and CSS code snippet:
<div class="">
<div data-th-if="${foo.prop1}" class="data-box"> some data </div>
<div data-th-if="${foo.prop2}" class="data-box"> some data </div>
<div data-th-if="${foo.prop3}" class="data-box"> some data </div>
<div data-th-if="${foo.prop4}" class="data-box"> some data </div>
... more divs ...
</div>
The above code displays a set of div boxes with certain properties. Here is the corresponding CSS:
.data-box {
width: 150px;
background-color: yellow;
margin-top: 0;
margin-bottom: 5px;
margin-left: 0;
margin-right: 5px;
border: 1px solid red;
}
Depending on incoming data values, different numbers of divs will be generated. I want to arrange these div boxes based on screen size - 5 divs for desktop, 3 for ipad, 2 for phone, and 1 for very low resolution phones. How can I achieve this layout using Bootstrap 4?