Click to See Complete Forum and Search --> : Netscape quirks


Pavon
01-04-2003, 09:31 AM
Hi all,

I have an <img> image inside a <TD> of 25 x 25 pixels

It works great in IE but in Netscape it insists in making the TD higher leaving a small gap at the bottom, making the TD 25x27.

Does anyone know why?

Thanks,

Fernando

Stefan
01-04-2003, 10:14 AM
Originally posted by Pavon
[B]Hi all,

I have an <img> image inside a <TD> of 25 x 25 pixels

It works great in IE but in Netscape it insists in making the TD higher leaving a small gap at the bottom, making the TD 25x27.

Does anyone know why?


Becuse according to the CSS spec default vertical-align for inline/text content is baseline and since <img> is handled the same way as text it also leaves a space below the textline (that is there to provide place for letters like jgpq which reach below the baseline)

The fix is to reposition you images. The easiest is to include this in all your global or external CSS

img {vertical-align:bottom;}

I usually add border:0 too so I won't have to repeat it on all images appearing in linkes.

img {vertical-align:bottom; border:0;}

A good default to have in all your CSS files.

blufive
01-04-2003, 11:54 AM
you can find a detailed discussion of this issue, including several potential solutions, in this article: http://devedge.netscape.com/viewsource/2002/img-table/

Pavon
01-05-2003, 01:19 PM
Thanks Stefan and blufive,

I think this sounds like it's definatly going to help....I will try it out.

Thanks!
Fernando