views:

52

answers:

2

I am assisting with the creation of a new website and tend to run into simple errors as I go. The following code is being used to style a link:

a.homepage-employment,
a:visited.homepage-employment {
display:block;
padding:5px;
background-color:#055830;
color:#fff;
width:100%;
}

a:hover.homepage-employment {
display:block;
padding:5px;
background-color:#999966;
color:#fff;
}

I am wondering why the background-color appears properly, but the text is not white when they are in the same class. Does the text color need to be within a separate class? I know I'm obviously missing something. Something most likely simple.

This is probably a very simple question, but I'm a beginner learning as I go. I appreciate your help :)

+5  A: 

i think your second group should be

a.homepage-employment:hover 
{ .... }

Proper form is: selector.class:pseudo-class {property:blah}

whatsisname
The same is true for your :visited pseudo-class in the first selector.
ajm
+1  A: 

Try:

a.homepage-employment {
    display:block;
    padding:5px;
    background-color:#055830;
    color:#fff;
    width:100%;
}

a.homepage-employment:hover {
    background-color:#999966;
}
Matt Bridges