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>

> 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

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); }

Received on Monday, 13 April 2009 13:16:29 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:35 UTC