views:

31

answers:

2

H3LLO,

For some reason there is 4px of extra padding appearing under the a element. I am seeing this manifest in both Firefox and Chrome. I remember seeing this phenomenon on Flickr in its early days except it was a blue bar that appeared under s wrapped in elements.

Here is a link to the example code that illustrates my problem. The background: of a has been colored red and the border: of img has been colored gray. As you can see, the a element is extending around 4px below the img.

To see the code just press the "Edit using JSBIN" link that appears at the top right corner when you hover over the window.

Any ideas on how to get rid of a element's extra bottom padding?

Thanks
Adam

+3  A: 

add vertical-align:bottom; to your img css properties.

pixeline
Yes. Images are not on the same baseline as text.
Rob
thanks @pixeline. it worked. @Rob so images always hover over the baseline by default?
J3M 7OR3
+1  A: 

I'm not positive why it occurs, but you could try YUI Reset to fix it.

Drew Wills
@Drew Wills is it best practice to include the YUI Reset at the beginning of all my CSS files?
J3M 7OR3
I believe it's better to link the YUI Reset seperately, before you link your own CSS file(s)
Drew Wills