oJM86o
oJM86o

Reputation: 2118

CSS for asp hyperlink

I've got CSS that looks like this:

a.HyperLinkHover
{
        color: #95FBCF; 
        background-color:#ff0;
        background-color: #377CB1;  
}

a.HyperLinkHover:visited { color:Purple;}

But when I click my <asp:HyperLink> where it is defined as:

<asp:Hyperlink runat=server id=hlfile cssclass=HyperlinkHover />

it does not have a purple color for being visited. I assume I did it wrong ?

Upvotes: 4

Views: 20399

Answers (1)

Mauro
Mauro

Reputation: 4511

unless you have a copy paste error then your cssClass doesnt match the CssDefinition

One has an uppercase Link and the other has a lower case link in HyperLinkHover

a.HyperLinkHover {
     color: #95FBCF;
     background-color:#ff0;
     background-color: #377CB1;   }  

a.HyperLinkHover:visited { color:Purple;}
/* hover style would come after visited */ 

and make sure the CssClass is defined with the same capitalisation

<asp:Hyperlink runat=server id=hlfile cssClass="HyperLinkHover" />

Upvotes: 8

Related Questions