Closed Bug 124210 Opened 23 years ago Closed 23 years ago

Implement :hover for other HTML elements (DIV, SPAN, IMG?)

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 5693

People

(Reporter: bugzilla, Assigned: dbaron)

Details

Currently, the CSS :hover pseudo-element only seems to work on the <A> element.
This is not a bug. Other browsers I've tested (namely IE 6 and Opera 6) show the
same behaviour.

Quote from the CSS 2 specs, http://www.w3.org/TR/REC-CSS2/selector.html#x39 :
"CSS doesn't define which elements may be in the above states [this refers to
:hover, :active, and :focus], or how the states are entered and left."

Thus, Mozilla _needn't_ implement :hover for other HTML elements, but I still
think it would be useful. Apparently, the W3C has done a bad job here: I cannot
find any specific information on tags which "may be hovered" in the HTML specs
either, but I don't think it should be up to the user-agent to decide whether an
element may have a :hover state. (I haven't looked at CSS3 specs for this yet
though; maybe it's better there.)

I do think though that :hover is useful for many elements, such as DIV, SPAN,
IMG (for example, change the border color), P, etc. Hopefully, competitive
user-agents will follow this idea.
This might be a dupe of bug #5693
We used to do this but stopped to some degree for performance reasons.  It also
messes up web pages that have selectors like ":hover", even though our behavior
was technically correct.

This might be a duplicate.
http://root.mystfans.com/cb_temp/hover.html

A testcase. The upper paragraph has a DIV on the right where :hover would
trigger a red instead of blue border. In the lower part, the A in the DIV has
the :hover. In this case, :hover is triggered properly, but it looks ugly (gets
cut at the height of a text line - known issue, methinks).
Soren the testcase you provided demonstrates one of the many issues caused by
bug 5693 . If this is the only case for it I'd say mark as dup of bug 5693 please
Acknowledged.

*** This bug has been marked as a duplicate of 5693 ***
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
[RFE] is deprecated in favor of severity: enhancement.  They have the same meaning.
Severity: normal → enhancement
Summary: [RFE] Implement :hover for other HTML elements (DIV, SPAN, IMG?) → Implement :hover for other HTML elements (DIV, SPAN, IMG?)
You need to log in before you can comment on or make changes to this bug.