How to remove underline of hyperlink?

Discussion in 'HTML & Website Design' started by alendonald, Jul 16, 2013.

  1. #1
    hello,
    I create a hyperlink of our menu item. but i wana to remove underline of menu. i use text-decoration: none; so its remove underline but also remove the like of my menu.
    so tell me How to remove underline of hyperlink?
     
    alendonald, Jul 16, 2013 IP
  2. GMF

    GMF Well-Known Member

    Messages:
    855
    Likes Received:
    113
    Best Answers:
    19
    Trophy Points:
    145
    #2
    What? Can you provide a screenshot of that?


    text-decoration: none removes the text decoration of a give tag. So it could be that you remove something that wasn't meant to be removed.
     
    GMF, Jul 17, 2013 IP
  3. mikehussy

    mikehussy Greenhorn

    Messages:
    68
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    6
    #3
    you can visit at google. there are more css tutorial sites.
     
    mikehussy, Jul 17, 2013 IP
  4. GMF

    GMF Well-Known Member

    Messages:
    855
    Likes Received:
    113
    Best Answers:
    19
    Trophy Points:
    145
    #4
    That's not helpful at all
     
    GMF, Jul 17, 2013 IP
  5. ekim941

    ekim941 Member

    Messages:
    74
    Likes Received:
    7
    Best Answers:
    7
    Trophy Points:
    33
    #5
    I'm not sure what you're trying to do here but there are two ways to limit which links have underlines.
    If you want to remove the underline from links in your except the active one, you could assign class="active" to the active menu and use this as your CSS
    a.active{
    text-decoration:underline;
    }
    Code (markup):
    If you want only the main navigation links to be underlined and the links in the content to have no underline, you could wrap your navigation in a div with an id="nav" attribute and use this as your css
    a:link, a:visited{text-decoration:none;}
    #nav a{
    text-decoration:underline;
    }
    Code (markup):
     
    ekim941, Jul 17, 2013 IP
  6. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #6
    A visit to Google is always in order. It should be among the first places any issue should be researched.
     
    kk5st, Jul 17, 2013 IP
  7. GMF

    GMF Well-Known Member

    Messages:
    855
    Likes Received:
    113
    Best Answers:
    19
    Trophy Points:
    145
    #7
    Granted, but you can pretty much post in EVERY thread "visit google to get your answer". It is not helpful.
     
    GMF, Jul 17, 2013 IP
  8. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #8
    A proper problem statement includes the steps taken to solve the issue. Since the OP did say he set {text-decoration: none;}, but did not mention any searches nor, for that matter, did he mention which section(s) of the specs he studied, a suggestion to Google was proper. It would have been better had some search terms been offered. I.E. stfw foo and bar, or rtfm css2.1 §xxx.

    cheers,

    gary
     
    kk5st, Jul 17, 2013 IP
  9. ekim941

    ekim941 Member

    Messages:
    74
    Likes Received:
    7
    Best Answers:
    7
    Trophy Points:
    33
    #9
    I agree... Google has to get its answers from somewhere.
     
    ekim941, Jul 17, 2013 IP
  10. jamjar919

    jamjar919 Well-Known Member

    Messages:
    332
    Likes Received:
    7
    Best Answers:
    5
    Trophy Points:
    180
    #10
    Place in your CSS:

    
    a {
    text-decoration: none;
    }
    
    HTML:
    Bear in mind this will remove ALL underlines from ALL hyperlinks. If you just want one to be not underlined, create a class in your CSS...

    
     .somethingDescriptive {
    text-decoration:none;
    }
    
    HTML:
    And then apply it to your hyperlink

    
    <a href="url" class="somethingDescriptive">Anchor Text</a> 
    
    HTML:
     
    jamjar919, Jul 17, 2013 IP
  11. GMF

    GMF Well-Known Member

    Messages:
    855
    Likes Received:
    113
    Best Answers:
    19
    Trophy Points:
    145
    #11

    Indeed, but user mikehussy didn't supply that, hence my "not helpful" response. Had he included search terms or links, which he found, no problem....


    Well, now we wait for OP to respond and clarify his problem.
     
    GMF, Jul 17, 2013 IP
  12. alendonald

    alendonald Greenhorn

    Messages:
    36
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    6
    #12
    Thank you for everyone, Today I try again and i hope finally i get right output.
     
    alendonald, Jul 19, 2013 IP
  13. kashifmughal

    kashifmughal Member

    Messages:
    74
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #13
    if you really would like to learn try w3schools as better for beginners and my first experience was there.
     
    kashifmughal, Jul 19, 2013 IP