IE 7 Display Bug - Help!

Discussion in 'HTML & Website Design' started by edr, Feb 3, 2007.

Thread Status:
Not open for further replies.
  1. #1
    I have a bug that is just driving me nuts - I have a table with an image that for SOME REASON I CANNOT FIGURE OUT is creating several pixels underneath of space.

    I have eliminated all the other table stuff so it is JUST the single image which should be bottom-aligned to the table and the table should ONLY be the height of the image yet for SOME REASON Internet Explorer seems to think I need some extra space (I am sooo frustrated).

    The full code is as follows:

    
    <table cellspacing="0" cellpadding="0" width="740" border="0" style="border-style:none;border-collapse: collapse;">
    
    <tr>
    	<td style="background-color:green;">
    		<a href="/home.asp" border="0"><img border="0" src="images/someimage.png"></a>
    		
    	</td>
    	
    </tr>
    
    </table>
    
    Code (markup):
    Is it because the image is a png?

    Any help appreciated.
     
    edr, Feb 3, 2007 IP
  2. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #2
    Try adding this at body tag:
    <body style="margin: 0px;">
    Code (markup):
     
    ajsa52, Feb 3, 2007 IP
  3. edr

    edr Guest

    Messages:
    784
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #3
    doesn't work =(
     
    edr, Feb 3, 2007 IP
  4. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #4
    Really strange. I've tried on IE7 and Firefox and works for me:
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head />
    <body style="margin: 0px;">
    
    <table cellspacing="0" cellpadding="0" width="740" border="0" style="border-style:none;border-collapse: collapse;">
    
    <tr>
    	<td style="background-color:green;">
    		<a href="/home.asp" border="0"><img border="0" src="image.gif"></a>
    		
    	</td>
    	
    </tr>
    
    </table>
    
    </body>
    </html>
    
    Code (markup):
     
    ajsa52, Feb 3, 2007 IP
  5. edr

    edr Guest

    Messages:
    784
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I've sent you a PM with the URL to see behavior for yourself - weirdest thing!
     
    edr, Feb 3, 2007 IP
  6. Clive

    Clive Web Developer

    Messages:
    4,507
    Likes Received:
    297
    Best Answers:
    0
    Trophy Points:
    250
    #6
    Pretty easy to fix. IE doesn't seem to like when you play alot with spaces in the source code around images.
    Try this:
    
    <table cellspacing="0" cellpadding="0" width="740" border="0" style="border-style:none;border-collapse: collapse;" bgcolor="#000000">
     <tr>
      <td style="background-color:green;"><a href="/home.asp" border="0"><img border="0" src="images/someimage.png"></a></td>
     </tr>
    </table>
    
    Code (markup):
     
    Clive, Feb 3, 2007 IP
Thread Status:
Not open for further replies.