Forum Moderators: not2easy

Message Too Old, No Replies

W3 :Hover Question

Is :hover supported by the W3 for all attributes?

         

JAB Creations

5:33 pm on Mar 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is IE wrong or actually following directions now? I'm curious if :hover is supported for items like say table.name1:hover for example.

createErrorMsg

5:47 pm on Mar 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is :hover supported by the W3 for all attributes

:hover is part of a selector, which in turn is applied to elements, not attributes. Nonetheless, here's a quote from the W3 [w3.org]:

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

So the answer is that IE isn't technically wrong in applying them to <a>nchors only, since the W3 doesn't say one way or the other. But from the POV of a designer, I think they're really selling us short by limiting the use of pseudoclasses in their browser.

cEM

jetboy

5:52 pm on Mar 8, 2005 (gmt 0)

10+ Year Member



Ha! Beat me to it. Here's what I've got:

From CSS 1:

"In CSS1, anchor pseudo-classes have no effect on elements other than 'A'. Therefore, the element type can be omitted from the selector"

From CSS 2.1:

"The :hover pseudo-class applies while the user designates an element (with some pointing device), but does not activate it. For example, a visual user agent could apply this pseudo-class when the cursor (mouse pointer) hovers over a box generated by the element."

"CSS doesn't define which elements may be in the above states, or how the states are entered and left. Scripting may change whether elements react to user events or not, and different devices and UAs may have different ways of pointing to, or activating elements."

So in CSS1, the W3C called these anchor psuedo-classes, and stated that they were only for links. By 2.1 any sort of specifics had been removed.

JAB Creations

7:40 pm on Mar 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So in CSS 2.1 it's up to the makers of the browser to determine if they will use the :hover selector?

Had IE supported the hover selector then my pages would all be able to be reduced by several KBs. IE7 will either deal with such issues or not. If it fails to cover such issues I will ban it from my web-site in order to promote W3 complaint code and faster loading of smaller files that don't have to cater to IE.