Mike Mike - 1 year ago 77
HTML Question

<img> vs <image> tag in HTML

I am writing an introductory HTML course. I remember discovering 9 years ago as I was learning HTML that both

worked as the tag for displaying images, at least in IE. Indeed,
still works in the latest versions of the 5 top browsers.

I realize that
is incorrect and will not validate with http://validator.w3.org. However, is anyone aware of a browser that will not display an image if
is used instead of

Furthermore, I assume the modern browsers display images created with the
tag simply because it is a common mistake that beginners make. Is this assumption correct?

Answer Source

Yes and no. As you point out <image> has been a synonym for <img> for a long time. I believe it was an early Netscape browser that first did this, possibly to compensate for user error, or possibly because there was dispute at the time whether the element should actually be called <image> or <img>.

Anyway, as pst points out, once it was implemented in a browser that dominated the market of the time, web pages came to rely on it. Its persistence is then down to commercial pressure on the browser manufacturers. If all the major browsers support it, then Browser A decides that although it supported it in Version V, it won't support it in version V+1, as soon as version V+1 is released, they get lots of messages saying "Site S is broken in your latest browser. You browser is rubbish. I'm going to switch to browser B".

The HTML5 parsing spec requires that the <image> tag is mapped to the img element at the tree construction stage, so there can never be any justification for using it.

I would be less concerned about browsers, than other HTML consumers, such as the lesser known search engines. I believe that the image for img synonym is not widely known, and the many such tools would therefore fail to pick up <image> as referencing an image resource.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download