[whatwg] The IMG element, proposing a CAPTION attribute

Andrew Fedoniouk news at terrainformatica.com
Sun Nov 19 20:35:57 PST 2006

Please see below,

----- Original Message ----- 
From: "Matthew Raymond" <mattraymond at earthlink.net>
Subject: Re: [whatwg] The IMG element, proposing a CAPTION attribute

| Alexey Feldgendler wrote:
| > On Wed, 15 Nov 2006 09:42:11 +0600, Matthew Paul Thomas 
<mpt at myrealbox.com>
| >
| >>> I believe HTML should have an element for every attribute intended to
| >>> hold human-readable text. A raw idea can go like this:
| >>>
| >>> <img id="img1" src="...">
| >>> <label for="img1" type="title">...</label>
| >>>
| >>> Here, <label> holds a value which should be treated the same way like
| >>> the title attribute on <img>, except that it can contain nested
| >>> markup. This would be useful for all attributes defined as %Text in
| >
| >> You would need to stipulate that title= couldn't contain any <a>
| >> elements. A link in a tooltip would usually be impossible to click. :-)
| >
| > Maybe, or maybe not. I'd say "not recommended" because not all ways of
| > such "labels" allow clicking links and other interactive elements like
|   I don't see the point of replacing attribute-based tooltips with
| elements. Many platforms/OSes don't have tooltips that support anything
| other than text. If you really want to replace text tooltips with
| elements that support HTML content, you might as well go all the way and
| allow people to use it as a means of creating popup content. Once you go
| down that road, people will be asking for it anyways.

"...Many platforms/OSes don't have tooltips that support anything
other than text...."

How task of tooltip creation in HTML is related to what OS is using for

As an example: here is a screenshot of HTML/CSS defined
tooltip in HTMLayout:
as you may see this is far from what OS is using.

For formatted tooltips HTMLayout (http://www.terrainformatica.com/htmlayout)
uses 'titleid' attribute that contains id of the element to show as a 

So if you have <span titleid="mytooltip">Bold</span>
and <div id="mytooltip">Rich content</div>
then that div will be shown as a tooltip for the span.

Pretty natural I would say.

For various popup purposes I have added <popup> element that is
display:none normally and has better semantic meaning so
we use <popup>s for such tooltips in almost all cases.

|   As for using <label> for this, I don't think overloading <label> is
| the best solution. The <label> element is fine for things like captions,
| which are arguably the same thing as labels. Tooltips are not labels,
| and the fact that a control can have a tooltip and a label would only
| make this more confusing. What would you do with this?...
|| <label for="img1" type="title">...</label>
|| <input id="img1" [...]>

Andrew Fedoniouk.

More information about the whatwg mailing list