On my website, I have a layout that displays 10 small images (around 100x200 pixels) evenly spaced at the bottom of the page.
| |
| The wide window layout |
| |
| |
| |
| +----+ +----+ +----+ +----+ +----+ +----+ +----+ +----+ +----+ +----+ |
| | | | | | | | | | | | | | | | | | | | | |
| | 1 | | 2 | | 3 | | 4 | | 5 | | 6 | | 7 | | 8 | | 9 | | 10 | |
| | | | | | | | | | | | | | | | | | | | | |
| +----+ +----+ +----+ +----+ +----+ +----+ +----+ +----+ +----+ +----+ |
| |
+-------------------------------------------------------------------------------------+
I want these images to wrap and center automatically if the browser window is resized to be narrower.
| |
| The more narrow window layout |
| |
| |
| |
| +----+ +----+ +----+ +----+ +----+ +----+ |
| | | | | | | | | | | | | |
| | 1 | | 2 | | 3 | | 4 | | 5 | | 6 | |
| | | | | | | | | | | | | |
| +----+ +----+ +----+ +----+ +----+ +----+ |
| |
| +----+ +----+ +----+ +----+ |
| | | | | | | | | |
| | 7 | | 8 | | 9 | | 10 | |
| | | | | | | | | |
| +----+ +----+ +----+ +----+ |
| |
+-------------------------------------------------------------------------------------+
I've experimented with using tables, divs, and combinations of both to achieve this effect, but haven't had any success.
If anyone has any creative solutions or ideas, I would greatly appreciate it!
The website utilizes PHP, but I've been attempting to solve this problem using HTML and CSS without much luck.