Alternate markup (§13.3.1)
If an object is not rendered (ex. to ignore an unsupported content type, or to reject potentially dangerous ActiveX controls), the contents of the <object>
element are rendered instead.
An image marked up <img>
can have alternate text, but an image marked up with <object>
can have alternate markup.
Example:
The <object>
element allows more versatile replacements for images.
<div align="center"><img src="/images/test/hr-grapevine.png" height=24 width=507 alt="~~~~~~~~~~~~~~~~~~ * ~~~~~~~~~~~~~~~~~~~"><div>
<p>With <code><img></code>, the most appropriate alternate text for a horizontal divider is generally a series of dashes:</p>
<div align="center"><img src="data:image/x-unsupported,TEST" alt="----------------------------------------"></div>
<p>But with <code><object></code>, a horizontal rule can be alternate markup:</p>
<div align="center"><object data="data:image/x-unsupported,TEST" type="image/x-unsupported">
Your Web browser renders it like this:
Suppose we want to use an image of a fancy horizontal divider:
With <img>
, the most appropriate alternate text for a horizontal divider is generally a series of dashes:
But with <object>
, a horizontal rule can be alternate markup: