Problem:
I can’t center the Image or there are spaces between my images. If I delete the spacing in the code it goes away. Why is this?
Solution:
img { display:inline}
If the img has no display attribute defined, the default display is inline. This means that the image can be centered with text-align:center from an outer element. However, if there is a space between images, it may show a space when it is displayed. You can think of inline display as treating the image like text.
img {display:block}
If the img has a display:block attribute defined, the image cannot be centered with the text-align:center from an outer element. The image will take up the full line so that the elements before and after will appear on a different line. Because the image takes up the whole line, centering the image doesn’t have any effects. Spaces between images also do not show because the image fills the whole line.
A nice explanation of inline vs block can be found here: http://www.webdesignfromscratch.com/html-css/css-block-and-inline/