Page 1 of 1

Plain format <a name="">

Posted: Tue Jul 22, 2003 9:57 pm
by nielsene
I know this is a very simple question, but I can't seem to get it to work.

I need to style a named anchor so that it doesn't change on any of the normal link behavoir, ie I want it to stay black text with no underlining. I thought this would handle it:
...
A.anchor {color: black; text-decoration: none;}
A.anchor:link {color: black; text-decoration: none;}
A.anchor:visited {color: black; text-decoration: none;}
A.anchor:hover {color: black; text-decoration: none;}
...
<a name="foo" class="anchor">

However, it still underlines it on hover, why? How do I stop it?

Posted: Tue Jul 22, 2003 10:34 pm
by qartis
add:

a:hover { text-decoration: none; }

See if that works :)

Posted: Tue Jul 22, 2003 10:38 pm
by nielsene
No change. (This is on Moz and on Safari...)

Posted: Tue Jul 22, 2003 10:52 pm
by qartis
Umm.. :)

What about this:

Code: Select all

<html>
<head>
<style type="text/css">
a,a:hover &#123;
text-decoration: none;
&#125;
</style>
</head>
<body>
<a href=google.ca>Link</a>
</body>
</html>
Are you using CVS moz? Do other css styles take effect (bold, colours)?

Posted: Tue Jul 22, 2003 10:58 pm
by nielsene
qartis wrote:Umm.. :)

What about this:

Code: Select all

<html>
<head>
<style type="text/css">
a,a:hover &#123;
text-decoration: none;
&#125;
</style>
</head>
<body>
<a href=google.ca>Link</a>
</body>
</html>
Are you using CVS moz? Do other css styles take effect (bold, colours)?
I'm using 1.2.1; I have a friend testing in 1.4. Neither work as desired. All other css seems to behave correctly.

In your above example, everything works, but that's a link, not an anchor.
Change your <a href="google.ca">Link</a> to <a name="foo">Foo</a> and it fails....

Posted: Tue Jul 22, 2003 11:03 pm
by nielsene
Hmm, very wierd.

Removing the color: black; style from
A.anchor:hover {color: black; text-decoration: none;}
made it work. Adding it back in, it resumes working. I'm very confused, but it works.... I wish I could reproduce it now to report as a bug... The w3c's style checker never showed a problem... I know the my site was using the most recent style sheet and not a cached copy... Anyways, thanks for the help. I just wish I knew why it misbehaved....