CSS Link Question

Hi can you please prodvide me with a fill example for this?

I have 3 classes (nav, footer, content)

I want all links to be same color with each class (active, hover, visited, link)

Nav = red
footer = blue
content = green

can you pleasee provide me with a full example?

Computer GuyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gurvinder Pal SinghCommented:
A.nav:link, A.nav:visited, A.nav:active, A.nav:hover {color:red;}
A.footer:link, A.footer:visited, A.footer:active, A.footer:hover {color:blue;}
A.content:link, A.content:visited, A.content:active, A.content:hover {color:green;}

You can use like this


.nav:link, .nav:visited, .nav:active, .nav:hover {color:red;}
.footer:link, .footer:visited, .footer:active, .footer:hover {color:blue;}
.content:link, .content:visited, .content:active, .content:hover {color:green;}


<a class="nav" href="#">nav</a>
<a class="footer" href="#">footer</a>
<a class="content" href="#">content</a>

Open in new window

Best of luck for your project.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.