Jump to content

a:link More than one set of rules per doc?


kath

Recommended Posts

I want to have two color combos for links on my page.1. my main div has black words and the hover changes it to black highlight/white words2. Outside my main div, the background color of the entire page is black. I have some links down at the bottom. Since my page is black, my links are obviously not showing.Here's the example: Page needing assistance. my code currently has the following: a:link { color: #000000; text-decoration: none; } a:visited { color: #000000; text-decoration: none; } a:hover { color: #fff; background-color: #B52C07;How do I change that (or add to it) in order to accomodate two sets of rules?Thanks.

Link to comment
Share on other sites

You must define classes for your links to have this effect.HTML:

<a href="http://www.google.ca" class="redLink">Google</a>

CSS:

.redLink { color: red; }

EDIT: Nice red border :)

Link to comment
Share on other sites

Thanks so much, Chris. Both of my problems are solved. :) I'm starting to get the hang of this css stuff. I made a quick study over the weekend. Now to update the rest of my site....I should add what I did (not exactly what you suggested, but you got me thinking on the right track):#underfooter { color: #666666; padding: 15px; } #underfooter a { color: #ffffff; }

Link to comment
Share on other sites

What I do in my design is I have many different ids: header, leftnav, hornav, content, footer. I simply set properties for different divs.

#footer a:link { color: #FF0000; }#leftnav a:link { color: #00FF00; }

This is just to give you an idea how it can be done easily.

Link to comment
Share on other sites

Excellent. I'm on the right track. I told my DH to take a class so he can manage my website (because I really should be editing photos). He is a programmer (Cobolt and C++) and should pick up on this pretty quickly.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...