HyperLink underline, how?

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

hey

asp.net 2.0

I have a HyperLink control on my webpage, I want this HyperLink to display a
underline when mouse is hovering over it. This is NOT a html link, but a
System.Web.UI.WebControls.HyperLink

This is my CSS (which I use to set font size and remove the underline, but
when mouse are hovering I want the link to display a underline):
..level0
{
font-size:small;
text-decoration:none;
color:Black;
}

This is my HyperLink:
<asp:HyperLink ID="hlTag0" runat="server"></asp:HyperLink>

I tryed this CSS class but don't generate a underline
..level0:hover
{
font-size:small;
color:Black;
}

Any suggestions?

Jeff
 
Jeff said:
hey

asp.net 2.0

I have a HyperLink control on my webpage, I want this HyperLink to display a
underline when mouse is hovering over it. This is NOT a html link, but a
System.Web.UI.WebControls.HyperLink

This is my CSS (which I use to set font size and remove the underline, but
when mouse are hovering I want the link to display a underline):
.level0
{
font-size:small;
text-decoration:none;
color:Black;
}

This is my HyperLink:
<asp:HyperLink ID="hlTag0" runat="server"></asp:HyperLink>

I tryed this CSS class but don't generate a underline
.level0:hover
{
font-size:small;
color:Black;
}

Any suggestions?

Jeff

What about this:

..level0,
..level0:visited,
..level0:hover
{
font-size:small;
text-decoration:none;
color:Black;
}

..level0:hover
{
text-decoration: underline;
}

Should that not work, then you'll need to view the produced source and
see how exactly the HTML looks like, because :visited and :hover only
apply to links.

HTH,
Laurent
 
Jeff napisa³(a):
hey

asp.net 2.0

I have a HyperLink control on my webpage, I want this HyperLink to display a
underline when mouse is hovering over it. This is NOT a html link, but a
System.Web.UI.WebControls.HyperLink

This is my CSS (which I use to set font size and remove the underline, but
when mouse are hovering I want the link to display a underline):
.level0
{
font-size:small;
text-decoration:none;
color:Black;
}

This is my HyperLink:
<asp:HyperLink ID="hlTag0" runat="server"></asp:HyperLink>

I tryed this CSS class but don't generate a underline
.level0:hover
{
font-size:small;
color:Black;
}

Any suggestions?

What borwser do you use? If it's IE - don't be surprised:) IE doesn't
support css well and doesn't understand for example pseudoclass
":hover" on anything else than "a" element.
First try your page in some modern browser (Firefox, Opera,
Safari,Konqueror and so on...). If it works in one of them - it's just
an stupid IE's lack of support of css.


In IE (and of course all newer browsers) try this selector:

a:hover{
//your settigs here
}

of course this will apply to all "a" elements in your page, but you can
modify this selector to be more precise. If links you want to apply this
style to are placed in any element that got id attribute you can change
this selector to:

#id_of_containing_element a:hover{
//yout settings here
}
 
Back
Top