CSS for asp hyperlink

I have CSS that looks like this:

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

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

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

he has no purple color to visit. I suppose I did it wrong?

+4
source share
1 answer

if you have no copy error then your cssClass does not match CssDefinition

One has a uppercase link and the other a lowercase 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 CssClass is defined with the same capitalization

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

All Articles