:hover color and background attributes aren't inherited correctly

VERIFIED INVALID

Status

()

Core
CSS Parsing and Computation
--
minor
VERIFIED INVALID
17 years ago
17 years ago

People

(Reporter: Jens-Erik Weber, Assigned: dbaron)

Tracking

({css2, testcase})

Trunk
x86
Linux
css2, testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

17 years ago
I have defined background and color for a:hover in a CSS.
Then there is a <div class="box"> with overwritten background and color
attributes for a:link and a:visited, while the color & background for a:hover
and a:active are not overwritten, so they should have the general assigned
values, i.e. the colours of the link should change, but they don't in Mozilla
0.97 for Linux and Windows, in Opera 6.0 TP 1 they do.

If you don't assign any of the values for "box a:link", "box a:visited", "box
a:hover" and "box a:active", the general assigned values apply and work
correctly. See 2nd alternate stylesheet in my testcase.

If you assign all of the values for "box a:link", "box a:visited", "box a:hover"
and "box a:active", then these overwritten values apply and work correctly. See
3rd alternate stylesheet in my testcase.

But overwriting only "box a:link", "box a:visited" without overwriting "box
a:hover" and "box a:active" doesn't work. I haven't tried other combinations
(and I don't have time for it).
(Reporter)

Updated

17 years ago
Keywords: css2, testcase
That's because hover is not currently hierarchical

*** This bug has been marked as a duplicate of 5693 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → DUPLICATE
(Assignee)

Comment 2

17 years ago
Why is this a duplicate.  Rather...
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
(Assignee)

Comment 3

17 years ago
... it's INVALID.  The selector ".box a:link" has higher specificity than any
a:hover so it overrides it.  MSIE has incorrect behavior where it doesn't treat
selectors with :hover according to the normal specificity rules.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 17 years ago17 years ago
Resolution: --- → INVALID

Comment 4

17 years ago
Reporter, CSS2 spec
http://www.w3.org/TR/REC-CSS2/selector.html#dynamic-pseudo-classes says:

"Note that the A:hover must be placed after the A:link and A:visited rules,
since otherwise the cascading rules will hide the 'color' property of the
A:hover rule."

Also hover.css has an error at line 11.
Status: RESOLVED → VERIFIED
Err whoops, my bad.  Been a rough week for me :(
You need to log in before you can comment on or make changes to this bug.