W3C home > Mailing lists > Public > www-style@w3.org > April 2009

Re: [Proposal] CSS 'tooltip' Property

From: Pascal Germroth <pascal@germroth.name>
Date: Mon, 13 Apr 2009 15:15:37 +0200
Message-ID: <49E33AF9.1070403@germroth.name>
To: Fran├žois REMY <fremycompany_pub@yahoo.fr>
CC: CSS 3 W3C Group <www-style@w3.org>
Hello,

> This property should have the same effect as the 'title' attribute on
> XHTML documents.
> I propose that because I just have seen that there's no way to emulate
> this attribute in CSS.
> 
> What do you think about it ?

I would rather propose a ::tooltip pseudo-element.
The default would be:

*::tooltip {
  content: attr(title);
  color: InfoText;
  background: InfoBackground;
}

But if one wants to display the URL and title for a link, in some other
form:

a[href]::tooltip {
  content: attr(title) " (" attr(href) ")";
  color: red; background: white;
}

This could replace the now used scripts which try to move a box after
the cursor.

More advanced tooltips could then be realized with:

e > x|tip { move-to: tt; }
e::tooltip { content: pending(tt), attr(title); }



-- 
pascal
Received on Monday, 13 April 2009 13:16:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 22 May 2012 03:46:58 GMT