Stylesheet hover not working for .net

I have the following css code:

.MenuNavigation A:link
      {color:#252C6A; font-family: arial; font-weight:bold; font-size: 8pt; text-decoration: none;}
.MenuNavigation A:visited
      {color:#252C6A; font-family: arial; font-weight:bold; font-size: 8pt; text-decoration: none;}
.MenuNavigation A:active
      {color:#252C6A; font-family: arial; font-weight:bold; font-size: 8pt; text-decoration: none;}
.MenuNavigation A:hover
      {color:#DEB405; font-family: arial; font-weight:bold; font-size: 8pt; text-decoration: underline;}


I have the following two links:
<font class="MenuNavigation"><a href="Home.aspx">HOME</a></font><br />
<asp:HyperLink ID="hlHome" runat="server" Text="Test home" NavigateUrl="Home.aspx" CssClass="MenuNavigation" />

The top link (HOME) works.  The style is applied.  However the bottom link (Test home) does not get the style applied.  Why is this?  I'd like to use the hyperlink control if possible, but I need to apply the above styles to it.
russomrAsked:
Who is Participating?
 
Sam_JayanderCommented:
Hi,
The declaration of CSS Class should go like this.

 A.MenuNavigation:link
    {FONT-WEIGHT: bold; FONT-SIZE: 8pt; COLOR: #252c6a; FONT-FAMILY: arial; TEXT-DECORATION: none}
 A.MenuNavigation:visited
    {FONT-WEIGHT: bold; FONT-SIZE: 8pt; COLOR: #252c6a; FONT-FAMILY: arial; TEXT-DECORATION: none}
 A.MenuNavigation:active
    {FONT-WEIGHT: bold; FONT-SIZE: 8pt; COLOR: #252c6a; FONT-FAMILY: arial; TEXT-DECORATION: none}
 A.MenuNavigation:hover
    {FONT-WEIGHT: bold; FONT-SIZE: 8pt; COLOR: #deb405; FONT-FAMILY: arial; TEXT-DECORATION: underline}


refer:
http://www.w3.org/TR/REC-CSS2/selector.html#link-pseudo-classes

HTH,
Sam
0
 
russomrAuthor Commented:
I'm an idiot.  Thank you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.