HyperLink underline, how?

Discussion in 'ASP .Net' started by Jeff, Aug 11, 2006.

  1. Jeff

    Jeff Guest

    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, Aug 11, 2006
    #1
    1. Advertising

  2. Jeff wrote:
    > 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
    --
    Laurent Bugnion, GalaSoft
    Software engineering: http://www.galasoft-LB.ch
    PhotoAlbum: http://www.galasoft-LB.ch/pictures
    Support children in Calcutta: http://www.calcutta-espoir.ch
     
    Laurent Bugnion, Aug 11, 2006
    #2
    1. Advertising

  3. 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
    }

    --
    PP
     
    Przemek Ptasznik, Aug 12, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest

    HyperLink underline

    Guest, Jan 4, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    3,679
    Vikesh
    Jan 5, 2005
  2. =?Utf-8?B?QW50?=

    Newbie: Removing underline from Hyperlink

    =?Utf-8?B?QW50?=, Sep 29, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    502
    Alexey Smirnov
    Sep 29, 2007
  3. Alan Z. Scharf

    Underline Hyperlink Column Heading Only

    Alan Z. Scharf, Dec 7, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    212
    Alan Z. Scharf
    Dec 17, 2004
  4. Dmitry N.Ananyev

    May I disable underline in one gridview Hyperlink field ?

    Dmitry N.Ananyev, Jun 29, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    291
    Jagdish
    Jul 1, 2005
  5. Girish B

    underline in hyperlink

    Girish B, Jul 30, 2007, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    143
    Girish B
    Jul 30, 2007
Loading...

Share This Page