• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 553
  • Last Modified:

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.
0
russomr
Asked:
russomr
1 Solution
 
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

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now