Reputation: 6695
Please take a look at this link: http://bethhaim.spin-demo.com/
I can't figure out why there is a whitespace of about 3 pixels between the image and the div below it. Anyone have an idea what is causing this?
Upvotes: 3
Views: 1700
Reputation: 146
The image tag is treated as an inline element, and it's displayed the same as if it were a long line of text. The extra space you see is for 'descenders' of lowercase text, the part that sticks out in 'j', 'y', etc.
a display: block
on your image will fix the gap.
More information: http://devedge-temp.mozilla.org/viewsource/2002/img-table/
Upvotes: 5
Reputation: 1781
If you set your img to display: block;
you shouldn't see the space anymore.
Upvotes: 2
Reputation: 35417
Your image is being displayed display:inline
with a line-height:18px
which is causing the spacing.
Either adjust the line-height
to something more appropriate or set the images' display to display:block
.
Upvotes: 9