Trying to solve this problem seems more complicated than it actually is.
I have 6 Images, each accompanied by a button below. Here's an example of what I'm working with: https://i.sstatic.net/sYCgC.png
The way I currently have them set up is like this:
<img src="Image.png" width="350" height="208" style="margin: 0px 16px">
<img src="Image.png" width="350" height="208" style="margin: 0px 16px">
<img src="Button.png" width="282" height="84" style="margin: 0px 16px">
<img src="Button.png" width="282" height="84" style="margin: 0px 16px">
Initially, everything looks fine on a regular browser window. However, when I resize the window, it ends up looking like this: https://i.sstatic.net/nzmkW.png
This distortion is due to how I have structured my images and buttons.
What I want to achieve is for them to appear like this when the window is resized: https://i.sstatic.net/KJW28.png
Is there a way to modify my basic HTML code so that the layout remains consistent regardless of the window width?
My goal is to transition from a maximum 2 by x
grid to a minimum 1 by x
grid as shown in the initial and final images.
Any guidance you can provide would be greatly appreciated.
I did come across a solution on Stackoverflow HERE, but it only works with squares which isn't applicable in my case.
I'm eagerly awaiting your assistance! :D
UPDATE
You can view the current state here: https://jsfiddle.net/du6Lu4ge/
Initial appearance: https://i.sstatic.net/PRbPN.png
Resized view: https://i.sstatic.net/iKy3k.png
:(