I need help designing a container that is responsive for both mobile and desktop, resembling the layout shown in this image. The initial HTML structure is as follows, but I can modify it by adding elements or classes if necessary.
<div class="container">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
</div>
After attempting to create this layout, my mobile version ended up with boxes 2 and 3 appearing swapped on the webpage. Ideally, I would like them to be displayed vertically and sequentially from 1 to 3. I considered using a container for boxes 2 and 3 so that I could utilize flex-direction: column-reverse
in the media query. However, this solution caused issues with the desktop view since I also needed a container for boxes 1 and 3 in order to arrange them in a column and set the flex-basis
. Any suggestions on alternative approaches would be greatly appreciated.