Old 12-08-2005, 15:54   #1 (permalink)
cathode
Registered User
 
Join Date: Jun 2004
Posts: 10
help with image spacing in css

Hello,
I am having a problem with a space above and below vertically stacked images in Mozilla:

Code:
<div class="centerer"><img src="images/image.jpg" /><img src="images/image.jpg" /><table border="0" cellspacing="0" cellpadding="0"> ... (table content ) ... </table> </div>

I have also tried it like this, with the addition of BR's:
Code:
<div class="centerer"><img src="images/image.jpg" /><br /><img src="images/image.jpg" /><br /><table border="0" cellspacing="0" cellpadding="0"> ... (table content ) ... </table> </div>

Note that I have no line breaks in between the tags. It looks fine in IE 6 but not mozilla... there's no padding or anything set for images.

Any ideas?
Thanks
  Reply With Quote
Old 12-08-2005, 16:16   #2 (permalink)
cathode
Registered User
 
Join Date: Jun 2004
Posts: 10
I have also tried specifying no padding in the CSS:
img {
padding: 0 0 0 0;
}
but that didn't help.
  Reply With Quote
Old 12-08-2005, 22:39   #3 (permalink)
adras
Zły
 
adras's Avatar
 
Join Date: May 2004
Location: Toronto, Canada
Posts: 2,091
Send a message via MSN to adras
Do you have a link, the code above shuldn't give you a space, but it could be caused by something else, what doctype are you using...
__________________
  Reply With Quote
Old 13-08-2005, 07:17   #4 (permalink)
smallbeer
I Ain't Losing Any Sleep™
 
Join Date: Apr 2003
Posts: 5,205
It may be because images are inline as default and sit on the bassline. They have a gap underneath them where the descenders (if needed) would go.

.centerer img {
display: block;
}

or

.centerer img {
vertical-align:bottom;
}

should fix it.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8