As I venture into the world of FLEXBOX, I find myself pondering a layout challenge that involves both Desktop and Mobile views.
The content I need to display consists of labels and corresponding data (not part of a form).
For Desktop view, my vision is for it to look like this:
label-------label-------label------label
Data--------Data--------Data-------Data
On Desktop, the width of label and data will be based on percentages depending on the number of elements present.
However, when switching to mobile, I envision the layout to transform into this:
label------ Data-------
Label------ Data-------
label------ data-------
Label------ Data-------
label------ data-------
When viewed on a mobile device, I aim for the label and data segments to each occupy 25% and 75% respectively.
I'm unsure whether the HTML setup should follow this structure:
<div class="container">
<div class="label">Label</div>
<div class="data">Data</a>
<div class="label">Label</div>
<div class="data">Data</a>
<div class="label">Label</div>
<div class="data">Data</a>
</div>
OR
<div class="container">
<div class="label">label</div>
<div class="label">label</div>
<div class="label">label</div>
</div>
<div class="container">
<div class="data">data</div>
<div class="data">data</div>
<div class="data">data</div>
</div>
Any advice or pointers on how to approach this would be highly appreciated! Thank you!