Forum Moderators: not2easy

Message Too Old, No Replies

How to apply CSS to in-page anchor links

applying css to links

         

mr_zedd

11:50 pm on Mar 20, 2008 (gmt 0)

10+ Year Member



Hello everyone,

I have been creating websites now for several years and have just got into the CSS way of doing things. So, I am now "converting" my older table websites into CSS.

I have external page links coded through CSS (see below) but the hover option (where it changes the colour to green) doesn't seem to affect an internal anchor link (#name) as it does with an external http (www.abc.com) link. I have looked at many "How to" pages but could not find the answer.

Is there some additional code I need to add to my CSS to enable the "#name" link to change on hover?

Thanks for any insight you can provide.

Mr Zedd

---- my existing CSS code -------
a:link {
color:#2570B1;
font-family: Verdana,Tahoma,Arial,sans-serif;
font-size: 10pt;
text-decoration: none }

a:hover {
color:#006C32;
font-family: Verdana,Tahoma,Arial,sans-serif;
font-size: 10pt;
text-decoration: underline }

a:visited {
color:#000000;
font-family: Verdana,Tahoma,Arial,sans-serif;
font-size: 10pt;
text-decoration: none }

Marcia

12:57 am on Mar 21, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The order should be

a:link
a:visited
a:hover

mr_zedd

3:34 pm on Mar 21, 2008 (gmt 0)

10+ Year Member



Hmm, your right. Now it works fine!

Such a simple little thing... once you know....

Thanks for your insight I appreciate it!

Mr Zedd