10

If I had an object like this:

 <p><object classid="…" height="…" width="…"><param name="…"value="…"/>
 <param name="…" value="…" /><param name="…" value="…" />
 <object data="…" height="…" type="…"><param name="…" value="…" />
 <param name="…" value="…" /></object></object></p>

Where would I put the alt tag so that the user will see text? The object that's being displayed in this code is a video and I've looked online for a solution, but I can't seem to find a clear answer. (The triple dots are just there to replace the code)

unor
  • 82,883
  • 20
  • 183
  • 315
Karen
  • 1,041
  • 3
  • 16
  • 26

2 Answers2

8

Just add alternative text between the tags like this:

<object data="img/failedToLoad.png" type="image/png">Alternative Text</object>
ThomasAFink
  • 939
  • 11
  • 21
1

According to the definition of object, the fallback content to be rendered when the object rendering fails is the element’s content. More exactly, it consists of all children of the object element except param elements. In fact, the sketchy code in the question contains such fallback content: the inner object element is fallback content for the outer one. To have a fallback for the fallback, put it inside the inner object element; it can be any content, including text:

 <p><object classid="..." height="..." width="..."><param name="..."value="...">
 <param name="..." value="..." /><param name="..." value="..." />
 <object data="..." height="..." type="..."><param name="..." value="..." />
 <param name="..." value="..." />This is fallback content.</object></object></p>

Note: Being fallback or alternate content means that the text is not displayed when object embedding is successful, i.e. a video presentation is shown.

Jukka K. Korpela
  • 178,198
  • 33
  • 241
  • 350