W3C home > Mailing lists > Public > www-style@w3.org > March 2004

Re: @viewport at-rule and 'title' (was Re: [css3] :viewport pseudo-class)

From: Lachlan Hunt <lachlan.hunt@iinet.net.au>
Date: Wed, 10 Mar 2004 12:25:58 +1100
Message-ID: <404E6EA6.4040900@iinet.net.au>
To: www-style@w3.org

Ernest Cline wrote:
> Actually, if CSS ever does so, ::tooltip or ::title would be more
> appropriate.  After all each element can have its own tooltip,
> so a pseudo-element would seem to be appropriate.
> 
> [alt]::tooltip {content:attr(alt)}
> [title]::tooltip {content:attr(title)}
> 
> would emulate the behavior of many browsers,
> 
> Thus there is no reason to preserve the property name 'title' for
> handling tooltip content.

   I totally agree with this idea!  For (X)HTML tooltips are only done 
with title and sometimes alt attributes, but for other XML languages, 
like XForms, a tooltip can be created from another element.

   For example, the XForms <hint> element is presented as a tooltip in 
the example rendering of the <secret> element [1].  If the ::tooltip 
pseudo element could handle this presentation, then I think it would be 
a very good, and necessary addition to CSS.

   Also, it may be good if tooltips could be styled, especially by user 
style sheets, for example to change size, colour, font, etc.  Also, an 
author may want to modify the tooltip to include both the title and alt 
attributes.
eg.
*[title][alt]::tooltip {
     content: attr(title) "\A" attr(alt);
}

[1] http://www.w3.org/TR/xforms/slice8.html#ui-secret

-- 
Lachlan Hunt
Received on Tuesday, 9 March 2004 20:26:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:27 GMT