0

So I'm a little stumped. I'm trying to make a page to display images. I want there to be 5 images per row spaced with maximum amount when the window is at max width (~950 px), but I want them to get closer as you make it smaller and then, when there's 0 px between them, there will only be 4 images per row, and that will continue until a specific width. Kind of like Instagram, but I don't want the pictures to get smaller. Here's what I have:

HTML

<ul>
   <li>
      <img src="0.png">
   </li>
</ul>
<ul>
   <li>
      <img src="1.png">
   </li>
</ul>
<ul>
   <li>
      <img src="2.png">
   </li>
</ul>

CSS

ul
{
    padding: 0;
    margin: 0;
    list-style-type:  none;
}

ul li
{
    display: inline;
}

//the images are also float left, so they are horizontal

Basically, as you can see, I have nothing and I don't really know what to do. I'd appreciate any help. Thanks!

iambriansreed
  • 21,935
  • 6
  • 63
  • 79
Shahar
  • 1,687
  • 2
  • 12
  • 18
  • Are answers with permitted?
    – Jim W Oct 18 '13 at 20:09
  • 1
    @JimW No. No. No. http://stackoverflow.com/questions/83073/why-not-use-tables-for-layout-in-html – iambriansreed Oct 18 '13 at 20:10
  • Remove the whitespace between the `
  • ` elements.
  • – Jon Oct 18 '13 at 20:12
  • @iambriansreed But images can be data, it could be a table of image data, no? – Jim W Oct 18 '13 at 20:13
  • @Mr.Polywhirl No because I want it to be flexible. I want the distance between the two images to decrease to 0 when I make the window smaller, but before that to be apart. – Shahar Oct 18 '13 at 20:14
  • @JimW Clearly it's not. – iambriansreed Oct 18 '13 at 20:18
  • @iambriansreed Sorry, how is it clear? – Jim W Oct 18 '13 at 20:24