Closed Bug 143676 (hover-named-anchor) Opened 22 years ago Closed 21 years ago

a:hover CSS setting being applied to named anchors

Categories

(SeaMonkey :: General, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 83031

People

(Reporter: stevem, Assigned: Matti)

References

()

Details

On my site (www.democracy2.org), I use anchors with the 'name' attribute, but
without 'href'.  This is for bookmarking/navigation purposes.  In my CSS file, I
have the a:hover tag set to perform a red underline.  But this is being applied
to the simple named anchor.  "The d2 Mission" header on the front page of my
site is a good example.  This shouldn't be happening, as hover is only supposed
to apply to href anchors--at least, according to every other browser I use
(Netscape, IE, Opera).  This is happening with RC2.
Nope, sorry.  Its just that other browsers don't know how to handle hovering on
things other than links.

a:hover applies to all <a> elements that you're hovering over.  If you want it
to apply only to those <a> elements that have an href attribute, your selector
needs to be

  a[href]:hover

http://www.w3.org/TR/REC-CSS2/selector.html#type-selectors
http://www.w3.org/TR/REC-CSS2/selector.html#attribute-selectors
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
So Mozilla is right and all other browsers are wrong.  mmmm k.  Despite what 
the standards require, it doesn't make sense for hover to work on a href-less 
anchor.  There's no need to indicate anything visually if the anchor isn't 
working as a weblink.  This isn't an invalid problem, but I'll let it go and 
change my CSS file.  geez.  Good thing I use separate CSS files for different 
browser classes (otherwise, I'd go mad).
> Despite what the standards require, it doesn't make sense for hover to work on
a href-less anchor.

Why not?  You told it to... You could always do what almost everyone else does,
and leave the element empty. Then your text formatting won't show up, besides
the fact that it will be pretty hard to hover over.

  <a name="foo"></a>

FWIW, try http://www.people.fas.harvard.edu/~dbaron/css/test/sec051103b in
Mozilla.  That shows off some of our hover behavior...
According to CSS2, :hover applies to everything.
See http://www.people.fas.harvard.edu/~dbaron/css/1999/09/links
VERIFIED
Status: RESOLVED → VERIFIED
I didn't "tell it to", when considering that no other browser interprets the 
CSS2 standard the way Mozilla is interpreting it.  Only in a strict technical 
sense would that be true.  Technicality is not always a greater value than 
compatibility.
*** Bug 148129 has been marked as a duplicate of this bug. ***
Just out of interest, would a RFE on A:hover not matching <a name=""> in Quirks
mode be acceptable as a new bug?
Another possible dup: bug 149704 (moved to evangelism)
*** Bug 153261 has been marked as a duplicate of this bug. ***
Reopening to mark as a dup of bug 83031.
Status: VERIFIED → UNCONFIRMED
Resolution: INVALID → ---

*** This bug has been marked as a duplicate of 83031 ***
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago21 years ago
Resolution: --- → DUPLICATE
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.