Chapsterj
Chapsterj

Reputation: 6625

visited link state

I'm having an issue when I try to set the visited state, it does not seem to work. Not sure why this is happening as the hover works but the visited does not. Any ideas why not?

 #nav li:visited a{ 
        background:#6b0c36;
    }

    #nav li:hover a{ 
        background:#6b0c36;

    }

Upvotes: 1

Views: 375

Answers (2)

zzzzBov
zzzzBov

Reputation: 179046

li elements cannot match the :visited pseudo-selector (think about what that would even mean). Anchors have locations that can have been visited, so if you need to change the style on a visited anchor, use:

#nav li a:visited
{
  background: #6B0C36;
}

Upvotes: 0

ariefbayu
ariefbayu

Reputation: 21979

what about this:

#nav li a:visited{ 
    background:#6b0c36;
}

#nav li a:hover{ 
    background:#6b0c36;

}

Upvotes: 2

Related Questions