Reputation: 2104
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?
Upvotes: 2
Views: 448
Reputation: 7303
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...
Upvotes: 1