Inspired by this question, where the poster casually states as fact that <object>
should be used instead of <img>
to embed images in HTML documents.
I'm developing a web app at the moment, and, being a perfectionist, I try to make it all shiny and compliant with all the standards. As far as I know, the <img>
tag is to be deprecated in the upcoming standards for xHTML, and as nowadays even IE is able to handle <object>
properly, I wanted to use the <object>
tag for all the images on my site
It became clear that the "upcoming standards" the poster was talking about was the abandoned XHTML2 spec, which didn't even formally deprecate <img>
anyway. (Although there were apparently rumors to that effect.)
To the best of my knowledge, I've not seen anyone in the web development community advocating for the usage of the general-purpose <object>
tag over the arguably more semantic and definitely more compatible <img>
tag.
Is there a good reason to use <object>
instead of <img>
? Should <object>
even be used at all in place of <img>
– what might this break?