Re: Giving alternate text semantical meaning

On Sun, May 04, 2003 at 03:37:48 -0700, Andy wrote:

> Just a rough idea I had, not sure if the 'img' tag is going to remain in 
> XHTML2 or not but this could still apply to whatever takes it's place.

I was under the impression that it was removed in favour of <object>
(which has been the preferred method since HTML 4, but woefully poorly
supported by MSIE).

> Imagine you have a company logo at the top of your page which reads 
> 'Acme' in some funky text (hence the image format). Your code might read 
> like so:
>    <img src="company_logo.gif" alt="Acme"/>

<object data="company_logo.gif" type="image/gif">

> Now if you were 'experiencing' this webpage with an aural browser, it 
> would just read off 'Acme' as normal text, but what if you could do 
> something like:
>    <img src="company_logo.gif" alt="&lt;h1&gt;Acme&lt;/h1&gt;"/>

You can, but that states that the rendered alt text should be

With <object>, however:

<object data="company_logo.gif" type="image/gif">

> This would give the alternate text some semantical meaning to anyone not 
> viewing the page in a visual/graphical browser. Obviously the current 
> method would make it impossible to print &lt; or &gt; into the document 
> as regular characters, but the idea still remains.

The alternative content might be a level 1 heading, but so is the
image. So this is the correct way to mark the content up using <img>
in XHTML 1.x.

<h1><img src="company_logo.gif" alt="Acme"/></h1>

David Dorward                           
         Redesign in progress:
2 and 5 are objects, as opposed to Java, where they are primitive thingies.

Received on Sunday, 4 May 2003 18:49:09 UTC