Re: A:hover

nir dagan writes:
 > Does the rule:
 > 
 > A:hover {color: red;}
 > 
 > indicates that 
 > 
 > 1. _all_ A elements (including <A name=foo>text here</A> )
 > turn red when the user hovers on them, 

Sort of. See below.

 > 
 > 2. or it just says that only those A elements that are used as 
 > links, i.e., with the href attribute set turn red?

No.

 > 
 > I think that the proposed CSS2 recommendation says 1. I therefore find the
 > example in chapter 5.11.3 of the spec. somewhat confusing.

I can see why. However, the spec says, just above the example:

    "CSS doesn't define which elements may be in the above states, or
    how the states are entered and left."

In other words, specifying X:hover is fine for any element X, but
whether something actually happens, depends on the UA. A browser that
can turn H1's red when the pointer hovers over it, can probably also
turn "<A name=foo>text here</A>" red, but there is no guarantee.


Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos/                              W3C/INRIA
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 4 93 65 76 92               06902 Sophia Antipolis Cedex, France
  +33 (0)4 92 38 76 92 (<--- after 5 Jan 1998)

Received on Sunday, 3 May 1998 17:52:32 UTC