View Full Version : Creating a tableless image grid with CSS

15 May 2012, 02:57 PM
Hey guys, as always Iím trying to do something seemingly simple and am having some bizarre issues. Iím just trying to make a simple image grid without using tables.

First issue is, why is there a space between the images here? It seems like itís adding a margin although Chrome developer tools is not saying that the images have any margin applied to them. I do want to have the images spaced out but I canít do the math necessary for doing that if some browsers are going to be randomly adding a margin.

I was able to fix this by floating everything left. Is this the proper fix? It still bugs me that I couldnít figure out why the images had space in-between

Let me know if Iím going about this wrong, is this how you guys would do a simple images grid? Also, I suck at math, how would you go about determining how large to make the images and how much margin? The parent container will be 960 Pixels and Iíd like rows of 5 across to be centered