Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jan 2005
    Posts
    148
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Easy small space question

    IE puts in a small space after an image

    I have the following code in my page:
    Code:
    <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:
    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

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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
    Code:
    <center><img src="camcorder.gif" width="141" height="133" style="border: 2px solid #B8CCDC"></center>
    see if that works, its an IE/PC bug

  • #3
    Regular Coder
    Join Date
    Aug 2004
    Location
    The Netherlands
    Posts
    211
    Thanks
    0
    Thanked 1 Time in 1 Post
    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

  • #4
    Regular Coder
    Join Date
    Jan 2005
    Posts
    148
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I fixed it by putting it on one line of code, and giving the image a vspace of 0

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •