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

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 UTC