SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Member
    Join Date
    Oct 2003
    Location
    Georgia
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    removing link underline

    Hello,
    I'm just starting to learn CSS. I'm having a little trouble removing the underlines from links.

    I use:

    a {
    text-decoration: none;
    }

    and in my body:

    <a href="link.html">link</a>

    This does not remove the underline from the link when viewed in the browser, but the link works as it should.

    If I use:

    a:link {
    text-decoration: none;
    }

    and in the body:

    <a:link href="link.html">link</a>

    This removes the underline, but the link will not work.

    Can someone please tell me where I'm going wrong here.

    Thanks

  2. #2
    SitePoint Enthusiast Big Joe's Avatar
    Join Date
    Jun 2003
    Location
    Ohio, U.S.A.
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use
    a:link {
    text-decorarion: none;
    }

    in your CSS, but in your HTML use <a href="link.html">link</a>.

    HTH

  3. #3
    SitePoint Member
    Join Date
    Oct 2003
    Location
    Georgia
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks,

    I tried that too. In this case the link is underlined, and works just fine.

    I'm getting either one or the other; the link is underlined and works, or the link is not underlined, but will not work.

    I'm viewing this in the browser view in Homesite 5.5.

  4. #4
    Ensure you finish what you sta bronze trophy John Colby's Avatar
    Join Date
    Aug 2003
    Location
    University of Central England, U.K.
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There's a typo:

    use

    a:link {
    text-decoration: none;
    }

    You might also consider defining a:hover, a:visited and a:active as well.
    John
    No electrons were harmed during the creation, transmission
    or reading of this posting. However, many were excited and
    some may have enjoyed the experience.

  5. #5
    SitePoint Enthusiast Big Joe's Avatar
    Join Date
    Jun 2003
    Location
    Ohio, U.S.A.
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, I just did a test page to make sure I hadn't given you bad instructions, and it worked. It must be a bug in Homesite that's making it not work.

  6. #6
    SitePoint Enthusiast Big Joe's Avatar
    Join Date
    Jun 2003
    Location
    Ohio, U.S.A.
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by John Colby
    There's a typo:

    use

    a:link {
    text-decoration: none;
    }
    Oops, I spelled it wrong in my post. Do you really think he spelled it that way when he tried it?

  7. #7
    SitePoint Zealot treefrog's Avatar
    Join Date
    Mar 2002
    Location
    Lawrenceville, GA
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DBull
    I use:

    a {
    text-decoration: none;
    }

    and in my body:

    <a href="link.html">link</a>

    This does not remove the underline from the link when viewed in the browser, but the link works as it should.
    try

    a.something {text-decoration: none;}

    and then reference "something" in the anchor tag like this

    <a href="link.html" class="something">link</a>

    anything outside of the anchor tag will result in a browser default blue underlined tag
    Making A Difference... www.newdayfoundation.org
    Helping Others Through Art
    www.artofgenerosity.com

    The Great Secret of the Universe www.secretofallages.com

  8. #8
    Ensure you finish what you sta bronze trophy John Colby's Avatar
    Join Date
    Aug 2003
    Location
    University of Central England, U.K.
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Big Joe
    Oops, I spelled it wrong in my post. Do you really think he spelled it that way when he tried it?
    Dunno, but when I tried it from your post by copying it took me a couple of minutes to spot it.
    John
    No electrons were harmed during the creation, transmission
    or reading of this posting. However, many were excited and
    some may have enjoyed the experience.

  9. #9
    SitePoint Member
    Join Date
    Oct 2003
    Location
    Georgia
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok folks, thanks for your patience and advice.

    I just tried all of your replys in a NEW site, and all of them work just fine,

    I can't begin to understand where things are going wrong, on the original page everything looks like it should ( no typos ), but just won't work. There may be a bug here; I'm going to investigate it a little more.

    DBull

  10. #10
    Super Ninja Monkey Travis's Avatar
    Join Date
    Dec 2001
    Location
    Sioux City, Iowa
    Posts
    691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Post a URL to the site so we can take a look and help find the problem. You could also try validating the CSS with the CSS Validator. It helps to spot typos and other invalid markup.
    Travis Watkins - Hyperactive Coder
    My Blog: Realist Anew
    Projects: Alacarte - Gnome Menu Editor


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •