Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS for asp hyperlink

Tags:

css

asp.net

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 ?

like image 422
oJM86o Avatar asked Feb 23 '23 12:02

oJM86o


1 Answers

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" />
like image 127
Mauro Avatar answered Feb 26 '23 23:02

Mauro