Click to See Complete Forum and Search --> : IE 6 Problem w/Images
mrbuzz
10-02-2005, 04:52 AM
Why does something so simple as this code result in IE 6 screwing up and putting in a line break at the end of the image? If I recall, this never existed in prior versions.
<table class="Header" cellpadding="0" cellspacing="0" border="1">
<tr>
<td id="Logo">
<img src="images/logo.gif">
</td>
</tr>
</table>
Images, Tables, and Mysterious Gaps (http://developer.mozilla.org/en/docs/Images,_Tables,_and_Mysterious_Gaps)
felgall
10-02-2005, 05:04 PM
<img src="images/logo.gif">
</td>
has a line break after the image
<img src="images/logo.gif"></td>
does not.
mrbuzz
10-03-2005, 02:45 AM
<img src="images/logo.gif">
</td>
has a line break after the image
<img src="images/logo.gif"></td>
does not.
Yes, after putting the ending td on the same line it works under IE.
But I wouldn't use this fix because it requires too much level of attention to actually typiing in code, rather than focusing on the document itself. That solution is too much "word processor" oriented.
Opera, Netscape, Firefox don't have this problem. This is a MSIE only problem that appears to have surfaced in IE 6.
There is a fix in CSS for this, but it is yet another band aid item one has to remember.
felgall
10-03-2005, 04:00 PM
IE6 recognises any whitespace between tags as a space - which is perfectly allowable acording to the definition of HTML. If you get in the habit of only including space where you want space then there is no problem. Linebreaks should only appear where a space is wanted in the page content or between attributes in tags.
There is a fix in CSS for this, but it is yet another band aid item one has to rememberThis (display:block or vertical-align:bottom) is not a fix, it is the way images are displayed. Remember it, you will be using this 'fix' often in your documents.