...

View Full Version : Easy small space question



techgearfree
03-12-2005, 02:37 AM
IE puts in a small space after an image

I have the following code in my page:


<center>
<img src="camcorder.gif" width="141" height="133" style="border: 2px solid #B8CCDC"> </center>
<table width="100%" height="4px" border="0" cellpadding="0" cellspacing="0">

<td height="1px"></td>

</table>
<table width="145" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#F4F4F4" style="border-right:2px solid #B8CCDC; border-left:2px solid #B8CCDC; border-top:2px solid #B8CCDC; border-bottom:2px solid #B8CCDC;">
<tr>
<td><div align="center"><a href="change_item.php"><font color="#275078" face="Verdana">Change
item</font></a></div></td>
</tr>
</table>


When I view the page in firefox, it is fine. there is about a 5px gap in between the picture and the table that says change item. This is due to the spacer in the code:


<table width="100%" height="4px" border="0" cellpadding="0" cellspacing="0">

<td height="1px"></td>

</table>


Now, when I view it in internet explorer, the 5px space turns into about a 10px space. I searched on google and it seems this is a problem with IE, and I tried doing what some people said to fix it (make sure they are on the same line of the code) but it didn't remove this space.


Thanks

_Aerospace_Eng_
03-12-2005, 05:47 AM
you are using many deprecated tags, there is not height="1px" should be style="height:1px;" or defined in CSS else where, either way, you image tag can't be on its one line, it has to be butted up together with the opening tags, like this

<center><img src="camcorder.gif" width="141" height="133" style="border: 2px solid #B8CCDC"></center>
see if that works, its an IE/PC bug

Jero
03-12-2005, 10:51 AM
Not only are you using some depricated tags, your entire code is depricated. You should look into DIV layouts which are styled with a CSS stylesheet. Here's a good site:
http://htmldog.com

techgearfree
03-12-2005, 03:42 PM
I fixed it by putting it on one line of code, and giving the image a vspace of 0

_Aerospace_Eng_
03-12-2005, 03:44 PM
i bet the vspace wont even matter by default vspace is 0, but putting it on one line is what i said to do in the first place :rolleyes:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum