{"id":394,"date":"2011-06-09T10:14:05","date_gmt":"2011-06-09T20:14:05","guid":{"rendered":"http:\/\/mymonkeydo.com\/?p=394"},"modified":"2011-06-09T10:14:05","modified_gmt":"2011-06-09T20:14:05","slug":"spaces-between-images","status":"publish","type":"post","link":"https:\/\/mymonkeydo.com\/spaces-between-images\/","title":{"rendered":"Spaces Between Images"},"content":{"rendered":"
I can’t center the Image or there are spaces between my images. \u00a0If I delete the spacing in the code it goes away. \u00a0Why is this?<\/p>\n
<\/p>\n
img { display:inline}<\/pre>\nIf the img has no display attribute defined, the default display is inline. \u00a0This means that the image can be centered with text-align:center from an outer element. \u00a0However, if there is a space between images, it may show a space when it is displayed. \u00a0You can think of inline display as treating the image like text.<\/p>\n
<\/p>\n
img {display:block}<\/pre>\nIf the img has a display:block attribute defined, the image cannot be centered with the text-align:center from an outer element. \u00a0The image will take up the full line so that the elements before and after will appear on a different line. \u00a0Because the image takes up the whole line, centering the image doesn’t have any effects. \u00a0Spaces between images also do not show because the image fills the whole line.<\/p>\n