views:

285

answers:

1

I have a small riddle here: one html page has a comment before img declaration, like this:

<!---->
<img src='shar.gif' alt='' class='center'/>

and another has not:

<img src='shar.gif' alt='' class='center'/>

Former image is rendered in ie6, while latter is not. Both pages are declared as XHTML 1.0 Transitional, and w3c validator says OK both for html and css for both pages. Opera, Firefox, Safari render image in both cases. Even ie 7.0 and ie 8.0 render the same.

Here is a small local version of robust sample. And here is a failure one. Any ideas why (empty or not) comment before an image makes it 'visible' in ie?

+1  A: 

I made a test page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
    <head>
     <title>img</title>
     <meta http-equiv=content-type content="text/html; charset=utf-8">
    </head>
    <body>
    <!---->
    <img src='smaller.jpg' alt='' class='center'/>
    </body>
</html>

Works well for me in FF 3 and IE 6. Maybe it has to do with the CSS?
Please post a wider sample...

Dror
Links are at the bottom of the question post. Thanks.
Alexander Vasiljev
please see Kobi's comment on question post - no access without Russian Picasa login
Dror
Sorry for that. Broken links are fixed. It's all about an app in development.
Alexander Vasiljev