Re: [Proposal] CSS 'tooltip' Property


> 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