Imagine having a series of images with text below them, all wrapped in a div and centered. There are 20 of these elements with similar image sizes but varying amounts of text.
The goal is to line up as many as possible on one row, each with 10px margin on the sides. They should be center-aligned and evenly fill the browser window width. If the window is very narrow, they should stack vertically.
If you have a CSS solution for this mobile-specific layout challenge, please share!
Update
Here's the basic HTML and CSS code I've been using:
<div class="m-parent-navigation-container">
<div class="m-icon-navigation-container">
<a class="m-icon-navigation-link"><img><br></a>
</div>
</div>
.m-parent-navigation-container
{
margin: 0 10px;
color: rgb(26, 46, 120);
font-size: 0.9em;
overflow: hidden;
}
.m-icon-navigation-container
{
float: left;
text-align: center;
width: 25%;
}
.m-icon-navigation-link
{
display: block;
font-family: OpenSansBold;
font-weight: normal;
text-align: center;
text-decoration: none;
}