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

Re: Fwd: [css4-ui] ::tooltip

From: Lea Verou <leaverou@gmail.com>
Date: Wed, 11 Apr 2012 20:09:59 -0700
Message-ID: <4F864787.10409@gmail.com>
To: Andrew Fedoniouk <news@terrainformatica.com>
CC: www-style@w3.org
This is not how pseudo-classes work. If you disagree with the way 
pseudo-classes work in CSS, please start another thread about it and 
don't hijack this one. Thanks.

With the way CSS currently works, `:tooltip` is equivalent to 
`*:tooltip`, which means "any element, when at the tooltip state" 
(however that tooltip state is defined). It cannot refer to different 
containers, such as tooltips. Pseudo-classes are used to classify 
elements, not to style something else. [1]

`:tooltip` might be reasonable when using another element as a tooltip, 
like some people in the thread already suggested. However, there are 
more efficient ways to refer to that, and we still need a way to style 
native, UA-generated tooltips without having to create a custom one for 

[1]: http://www.w3.org/TR/CSS21/selector.html#pseudo-elements

Lea Verou (http://lea.verou.me | @LeaVerou)

On 11/4/12 19:54, Andrew Fedoniouk wrote:
> There is one tooltip on the screen at any given moment of time so 
> :tooltip { background:gold; } will work just fine. If you want 
> different styling for different elements then we can use shadow tree 
> combinator/selector here: div[title] -> :tooltip { background: gold; } 
> div[title] -> :tooltip { background: green; } where '->' is that 
> shadow tree combinator (does not exist yet but it seems we are getting 
> there). -- Andrew Fedoniouk. http://terrainformatica.com 
Received on Thursday, 12 April 2012 03:10:37 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:14 UTC