W3C home > Mailing lists > Public > www-html@w3.org > May 2003

Re: Giving alternate text semantical meaning

From: David Dorward <david@us-lot.org>
Date: Sun, 4 May 2003 23:49:00 +0100
To: Andy <aholmes84@shaw.ca>
Cc: www-html@w3.org
Message-ID: <20030504224900.GA13058@us-lot.org>

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">
  Acme
</object>

> 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
<h1>Acme</h1>.

With <object>, however:

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


> 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                                     http://david.us-lot.org/
         Redesign in progress: http://stone.thecoreworlds.net/
2 and 5 are objects, as opposed to Java, where they are primitive thingies.
Received on Sunday, 4 May 2003 18:49:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:55 GMT