HTML & CSS
I am trying to redesign a site with xhtml, but am getting a whitespace of about 2px at the bottom on my table cells. This happens ONLY in Mozilla. Does anyone know why?
Here is the page:
I had the same problem and found the solution on google groups.
Check out this link for the long answer:
In short, use this in your stylesheet (or create a seperate class to handle the specific situation that is causing your problem):
Should have looked on sitepoint first as I've answered this question hundreds of times in the css forum
Hmm that article doesn't seem to adress the correct reason (unless I missed it when I read quickly through it ).
Images are treated the same as text by some browsers (and depending on doctype mode etc). What this means is that an image will sit on the baseline (not the bottom) exactly the same as text does and will allow room underneath for descenders in the text.
Setting the image to display block will solve the problem or setting the image to vertical-align:bottom if other content is n the cell and display:block can't be used.
Hope that helps.
This page has always helped me understand the mysterious gaps:
This topic is now closed. New replies are no longer allowed.