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?
Plain format <a name="">
Moderator: General Moderators
Umm.. 
What about this:
Are you using CVS moz? Do other css styles take effect (bold, colours)?
What about this:
Code: Select all
<html>
<head>
<style type="text/css">
a,a:hover {
text-decoration: none;
}
</style>
</head>
<body>
<a href=google.ca>Link</a>
</body>
</html>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.qartis wrote:Umm..
What about this:
Are you using CVS moz? Do other css styles take effect (bold, colours)?Code: Select all
<html> <head> <style type="text/css"> a,a:hover { text-decoration: none; } </style> </head> <body> <a href=google.ca>Link</a> </body> </html>
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....
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....
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....