...

Links and CSS's

lukec
06-29-2002, 08:17 AM
Hello, what I want to do seems to should be simple (not sure, I am writing my first style sheet). I want change the properties of all links, but protect a few. I have tried to use the following:

a:hover { color: blue }
a .protected:hover { color: white }

I want all links to be blue, expect those in protected class. The above example turns all links blue. I could create two unique classes (not use the 'a') but I don't want to protect the vast majority of my links. If a guru;) doesn't have the answer, I might just write it in locally:eek: since the protected links are in a templete.

Thanks a bunch.-Luke

boxer_1
06-29-2002, 08:33 AM
Ok, you should define your links in all states (IE: link, active, visited,hover) in CSS to get a consistant result. For what you're trying to do, try this:

A:link {color: #0000ff;}
A:active {color: #0000ff;}
A:visited {color: #0000ff;}
A:hover {color: #0000ff; }

A.protected:link {color: #ffffff;}
A.protected:active {color: #ffffff;}
A.protected:visited {color: #ffffff;}
A.protected:hover {color: #ffffff; }

Then in the links you want to be white, you add the 'protected' class like this:

<a class="protected" href="whatever.html">White Link</a>

Does this help? Good luck ;).

lukec
06-29-2002, 06:50 PM
Yah, that is perfect:thumbsup:. Thanks a lot man. -Luke

boxer_1
06-29-2002, 08:08 PM
Originally posted by lukec
Yah, that is perfect:thumbsup:. Thanks a lot man. -Luke

You're welcome, glad it helped you out :thumbsup: ! Should you wish to further you CSS knowledge, here's a good all 'round resource: http://www.w3.org/Style/CSS/ and, of course, you know where to come (http://www.codingforums.com/) with any questions you may have in the future :D .



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum