Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 14 of 14
  1. #1
    New to the CF scene
    Join Date
    Feb 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can't remove underline from links

    Hi all,

    Here is the header section from the web page I'm trying to create:

    <head>
    <style>
    <!-- Hide from older browsers
    a:link {color: #c0c0c0; text-decoration: none;}
    a:visited {color: #c0c0c0; text-decoration: none;}
    a:hover {color: #0000FF; text-decoration: none;}
    a:active {color: #FFFFFF; text-decoration: none;}
    // end hiding contents -->
    </style>
    </head>

    Each link looks OK *after* I click on it - i.e. no underline, hover changes to blue, last clicked changes to white, visited are grey. However, when the page is initially loaded ALL links are blue and underlined.

    This is for a navigation menu, and I really don't want underlines at all.

    I've tried the page in IE6 and Firefox, so unfortunately I don't think I can blame MS this time. Can someone please tell me what I've done wrong before I spit the dummy and convert all my text links to graphics? Any help would be greatly appreciated.

  • #2
    Regular Coder ArcticFox's Avatar
    Join Date
    Jan 2004
    Location
    Vostok Station, AQ
    Posts
    602
    Thanks
    35
    Thanked 3 Times in 3 Posts

    Internet Explorer

    If we could see the actual page, or if you would paste the complete code, it would help us a lot more...


    Questions:
    Are you on a 'free' host?
    Have you checked your browser settings?

    <div> - putting your mind in a box since 1997

  • #3
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    Try:

    a { color: #c0c0c0; text-decoration: none; }

    I don't know why, but that usually works better for me than a:link when declaring global style on links...

  • #4
    New to the CF scene
    Join Date
    Feb 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by ArcticFox
    If we could see the actual page, or if you would paste the complete code, it would help us a lot more...


    Questions:
    Are you on a 'free' host?
    Have you checked your browser settings?

    Thanks, Arctic.

    I can't post the full page details, as it's a top-secret ASIO page detailing the suspected whereabouts of the Easter Bunny (seriously, I can... but only if I change some info first, which I will do if need be).

    It's not a free host.

    I'm not sure exactly which browser settings apply. Currently IE's "Underline Links" option is set to "always".... BUT, as I said earlier, the links do appear as I expect after they have been clicked ie, the underline disappears, and colors are correct.

  • #5
    New to the CF scene
    Join Date
    Feb 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by rmedek
    Try:

    a { color: #c0c0c0; text-decoration: none; }

    I don't know why, but that usually works better for me than a:link when declaring global style on links...
    I tried this (replacing the a:link line with the above, but keeping the rest), there was no change. Or did you mean to remove all the other lines? I really do want the different colors for hover etc...

    Thanks for your help.

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    you dont have any other type of inline styling do u on your links? like maybe a <u> tag?

  • #7
    New to the CF scene
    Join Date
    Feb 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by _Aerospace_Eng_
    you dont have any other type of inline styling do u on your links? like maybe a <u> tag?
    No <u>s.... I have published a test page which shows the problem, the URL is http://blayneybytes.com/htmltest

    Thanks Aerospace_Eng & others for your help.

  • #8
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    oh, man...

    Your problem is that the ONLY part of your website so far that's coded correctly is the stuff we gave you .

    The short answer might be that you need to declare links inside table cells as well:

    td a { properties }

    The long answer is, here's what you're going to need before things like links are going to be underlined or not:

    - some kind of doctype
    - a <html> tag
    - proper style tags (<style type="text/css">)

    And then there are other things, like deprecated tags (tags that are not supported anymore in certain doctypes), using tables for layout...

    Don't get too worried, though; it seems as if you are a beginner at this, and there's no better time then now to learn how to do it all right. Check out a few of these great tutorials...

    http://htmldog.com
    http://www.w3schools.com

    HTML is easy, but it does take a little "homework" to get a grasp of how it works. Hope this helps,
    Last edited by rmedek; 02-09-2005 at 12:05 PM.

  • #9
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    rmedek just touched base on a few problems but about your css to style your links its those words u have in your comments that are making it not work, change your css for your links to this
    Code:
      <style type="text/css">
      <!--
         a {color: #c0c0c0; text-decoration: none;}
         a:visited {color: #c0c0c0; text-decoration: none;}
         a:hover {color: #0000FF; text-decoration: none;}
         a:active {color: #FFFFFF; text-decoration: none;}
      -->
      </style>
    and the rest well u gotta start somewhere

  • #10
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    Quote Originally Posted by _Aerospace_Eng_
    rmedek just touched base on a few problems but about your css to style your links its those words u have in your comments that are making it not work
    That's the third time this week I overlooked an easy way to solve a problem... I need to relaaax

  • #11
    New to the CF scene
    Join Date
    Feb 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ouch!

    Well, I'm not entirely an HTML newbie - I was writing it 10 years ago (when all of that stuff was legitimate code)... but I admit to have only just started again after a few years off in the wilderness.

    In fact, a few years ago, I looked at CSS and stopped, because it just didn't work at all in either IE or Netscape - I forget which.

    I have never seen any page that didn't work because it didn't have a doctype or <html> tag, but I guess things can change.

    As for tables for layout, I have never found a design I couldn't create using them. However, I suppose it might be time to get out of the stone age... I promise to check out the links you provided.

    I'll try the last couple of suggestions, and report the results.

    Thanks guys

  • #12
    New to the CF scene
    Join Date
    Feb 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Problem solved! Aerospace_Eng & RMedek, I owe you a beer.

    I know I have a lot to catch up on.... like for example in the new age, comments can't actually contain comments ;-)

    Thanks heaps for your help guys

  • #13
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    im not old enough to drink a beer in the US legally but i guess u'll have to buy two for rmedek

  • #14
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    Quote Originally Posted by bbcs
    I know I have a lot to catch up on.... like for example in the new age, comments can't actually contain comments ;-)
    Well, remember, the comments bit is only to keep browsers that don't understand <style> from reading the text within. Browsers that do understand style read the text, so they read the extra stuff you type in, too. You can enter comments in stylesheets like so:

    /* commenting here */

    BTW, you can actually leave those comment tags out, it's very rare nowadays for a browser to trip on that part.

    Quote Originally Posted by _Aerospace_Eng_
    im not old enough to drink a beer in the US legally but i guess u'll have to buy two for rmedek
    No way, man, you earned it. I won't tell


  •  

    Posting Permissions

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