CSS for links colour - different colours for content and navigation

I have two sections of CSS whereby I would like links to appear different within content and appear separately for links in a list/navigation bar. I just want the colours to be different. But it is not working. The main content I am using the colour green and for the list/navigation I would like them to be black. How do I do it? What needs changing in the below code:

CSS content styles:

A:link{
color: green; 
text-decoration: none;
}

A:visited{ 
color: green;
text-decoration: none;
}
A:hover{
color: green;
text-decoration:underline;
}
A:active{
color: green;
text-decoration: none;
}



CSS list/navigation styles:

.activelink{
font: 80% Arial;
font-size:12px;
line-height:19px;
color:black;
}
.activelink ul{
color:black;
list-style-type:none;
margin:0;
padding:0;


}
.activelink li{
padding:1px;
color:black;
}
.activeink a:link, .footlink a:visited{
color:black;
background-color:none;
text-align:left;
text-color:#003399;
text-decoration:none;
}
.activelink a:hover, .footlink a:active{
color:black;
background-color:none;
text-decoration: underline;
text-colour:#003399;
}

What’s the HTML associated with that?

I should note that you have a typo

.activeink a:link, .footlink a:visited{
color:black;
background-color:none;
text-align:left;
text-color:#003399;
text-decoration:none;
}
What’s wrong with that?

oh i see - just typos.

footlink should be activelink too.

Changing the wrong bits of code makes it work.

Thanks,

Matt.

Why do you have text-color in there? It’s not a valid css attribute. You’d use color (which you’re currently setting to black)

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.