How To Change Link Color

Discussion in 'JavaScript' started by HisZd, Jul 29, 2006.

  1. #1
    How do you change link color??:confused:
     
    HisZd, Jul 29, 2006 IP
  2. coderlinks

    coderlinks Peon

    Messages:
    282
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #2
    coderlinks, Jul 30, 2006 IP
  3. Net-Margin

    Net-Margin Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    As said above I would use CSS, but use it internally or externally instead of on the a href style. For example.

    a:link {
            color: #000;
            text-decoration: none;
    }
    HTML:
    I would also look at W3Schools CSS section as it will help you with the other link elements as well, you can use Javascript with OnMouseOver and onClick but not many people do that anymore.
     
    Net-Margin, Jul 31, 2006 IP
  4. Cheap SEO Services

    Cheap SEO Services <------DoFollow Backlinks

    Messages:
    16,664
    Likes Received:
    1,318
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hey,

    I have a CSS question too! Here's my code:

    .tdsmall
    {
    font-family: verdana, arial;
    color: #FFFF00;
    font-size: 8pt;
    }

    .tdhead
    {
    color: #FFFF00;
    font-weight: bold;
    }

    .error
    {
    color: #FF0000;
    font-weight: bold;
    }

    .navcurrent
    {
    background-color: #00FF00;
    }

    .message
    {
    font-family: verdana, arial;
    color: #666666;
    }

    .formhead
    {
    font-family: verdana, arial;
    color: #FFFF00;
    background-color: #000066;
    font-size: smaller;
    font-weight: bold;
    }

    .productname
    {
    font-family: verdana, arial;
    color: #FFFF00;
    font-size: smaller;
    font-weight: bold;
    }

    .productsbanner
    {
    font-family: arial, verdana;
    color: #000000;
    font-size: 20px;
    font-weight: bold;
    font-align: right;
    }

    .category
    {
    font-family: verdana, arial;
    color: #FFFF00;
    background-color: #000000;
    font-size: 17px;
    font-weight: bold;
    font-align: right;
    }

    td
    {
    font-family: verdana, arial;
    color: #000000;
    font-size: smaller;
    }

    a
    {
    text-decoration: none;
    font-family: verdana, arial;
    }

    a:visited
    {
    color: #000066;
    font-family: verdana, arial;
    }

    a:hover
    {
    color: #0000FF;
    font-family: verdana, arial;
    text-decoration: underline;
    }

    a:link
    {
    color: #0000AA;
    font-family: verdana, arial;
    }

    a:active
    {
    color: #0000CC;
    font-family: verdana, arial;
    }


    Now, I want to change the sidebar to Dark Blue, the body background to black and have links Gold and visited links green.

    Anh help here that is successful will get green rep.

    Ta!

    Col

    Woops! The site is www.opals4sale.com and the page is products.asp
     
    Cheap SEO Services, Aug 1, 2006 IP
  5. frankcow

    frankcow Well-Known Member

    Messages:
    4,859
    Likes Received:
    265
    Best Answers:
    0
    Trophy Points:
    180
    #5
    how about this:

    body
    {
    background: #000;
    scrollbar-base-color: #4F8EB0;
    }


    a:link, a:active, a:hover
    {
    color: #E2C422;
    }

    a:visited
    {
    color: #679E67;
    }
     
    frankcow, Aug 2, 2006 IP
  6. Nafai

    Nafai Peon

    Messages:
    105
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    If you want to change just that ONE link, you don't even need html, just put the color tag inside the anchor tag:

    [a href="mylink.html"][font color=red]my link[/font][/a]

    But, if you want to change more than one link, like two or three or five or all of them, CSS is the way to go.
     
    Nafai, Aug 7, 2006 IP