Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unwanted space below image in IE 1

Status
Not open for further replies.

Dweezel

Technical User
Feb 12, 2004
428
GB
I have a table page layout with 3 rows. In the middle row I have a large image and in the cell bellow that there is a 1px CSS border on the top edge of the cell.

My problem is that when viewed in IE there is a small gap between the bottom of the image in the middle cell, and the border at the top edge of the cell below it. There is no gap there in NN or Firefox.

The cellpadding and spacing are both set to 0.

Any ideas?
 
Looks like a whitespace problem. IE handles whitespace incorrectly and will render whitespace that exists between the tags as spaces on the page. That means that in the table cell in IE you have an image and a space. If your code looks like this:
Code:
<td>
  <img src="mybigimage.jpg" width="300" height="150" alt="title image" />
</td>
changing it to:

Code:
<td><img src="mybigimage.jpg" width="300" height="150" alt="title image" /></td>
should do the trick. If not, posting some code would help us help you.
 
Thanks Vragabond you were absolutely right about it the whitespace that was causing the problem. I guess I've got to add this to the list of browser quirks I've got to watch for. It's a pretty long list!

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top