Re: Scope of :hover

Eric A. Meyer wrote:
> At 17:55 -0400 5/29/03, Ernest Cline wrote:
>> Is :hover supposed to apply to any element that a pointer is over,
>> or is it supposed to apply only to elements that can be activated
>> that the  pointer is over, or is this a decision left to user
>> agents?
>
> CSS doesn't define which elements may be in the above states, or how
> the states are entered and left."
> (http://www.w3.org/TR/REC-CSS2/selector.html#dynamic-pseudo-classes)
>
>     So under that definition, it's up to UAs to decide which
> elements can be hovered (or activated) and which can't-- they can
> restrict these things to hyperlinks, or apply them to any element
>     at all. However, my reading of CSS3 leaves me with the distinct
> impression that the authors were trying to imply that only
> "interactive" elements should get the hover/active/focus states,
> which would be a change of implication from CSS2.  Perhaps some
> clarification on that point would be helpful.

It's sensible that only interactive elements can accept the :hover
pseudo-class. These are the only elements that can be "clicked on" to do
something, and a change of colour/underline etc almost always implies a
link.

It's also sensible for it to be applicable to any element and leave it up to
the author to write the CSS as appropriate. e.g.:
<li href="some.link">Click here</li>
<li>Can't click here</li>
should then use li[href]:hover to specify the linked <li>


Matt

Received on Friday, 30 May 2003 11:44:48 UTC