Re: [Proposal] CSS 'tooltip' Property

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 UTC