1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

-html links without changing color-please help

Discussion in 'HTML & Website Design' started by Reptileman42, Sep 23, 2007.

  1. #1
    hi guys. i really need to know, is there any way that i can make a link with the color chaning after you've clicked it?
    thanks
    riley
     
    Reptileman42, Sep 23, 2007 IP
  2. XTreMe

    XTreMe Banned

    Messages:
    1,226
    Likes Received:
    57
    Best Answers:
    0
    Trophy Points:
    0
    #2
    change the visited link-and link colors you can easily do this with frontpage
     
    XTreMe, Sep 23, 2007 IP
  3. foreststone

    foreststone Peon

    Messages:
    1,355
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #3
    <body link="#330000" vlink="#663300">
    edit the code, link="clore"(visit before color), vlink="clore"(after visit color)
     
    foreststone, Sep 23, 2007 IP
  4. Reptileman42

    Reptileman42 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    thanks guys.
    foreststone, im only 12 so i dont understand much =D,
    if i wanted to keep the color the same for the following link, could you please edit it? thanks so much
    <font color=white>
    <a href=home.html>home</a>
     
    Reptileman42, Sep 23, 2007 IP
  5. XTreMe

    XTreMe Banned

    Messages:
    1,226
    Likes Received:
    57
    Best Answers:
    0
    Trophy Points:
    0
    #5
    if you want to use the ssame color then use
    <body link="#330000" vlink="#663300">
    body link and vlink color same for same replace 663300 with 330000
     
    XTreMe, Sep 23, 2007 IP
  6. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #6
    No! He's just starting with web development, why not start him on the right track by getting him to not use deprecated crap like that...

    Use CSS, inside the <head> and </head> of your HTML, add this:

    <style type="text/css">
    body { background-color: black; }
    a { color: white; }
    a:visited { color: #ccc; }
    </style>
    Code (markup):
    That will colour all links white and visited links will be a light shade of grey.

    Also, you should use quotes around attribute values and your home page should be index.html, e.g.:
    <a href="index.html">Home page</a>

    Not: <a href=home.html>Home page</a>
     
    krt, Sep 23, 2007 IP
    Colbyt likes this.
  7. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #7
    Reptileman42

    Krt is correct. Both will work but if you are just starting try to learn the right way to do things from the start. You can set your style attributes in the <style> section or in a css file that you link to.

    The css file makes future changes much easier as you only change one file to change the entire site.
     
    Colbyt, Sep 23, 2007 IP
  8. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #8
    And as an overall:

    links are generally affected by 4 states (there's more than 4 but most people just use 4): how the link looks normally (called a:link), how it looks after someone's clicked on it (a:visited), how it looks when someone's got the mouse over it (a:hover) and what it looks like while they're clicking it (a:active). With CSS styling, you can make all those different colours if you want. Hover always looks cool.

    So in krt's code,
    <style type="text/css"> <--- says it's CSS styling
    body { background-color: black; }
    a { color: white; } <--- a means all things you can click on, usually links
    a:visited { color: #ccc; }<--- the colour of clickie things after they've been clicked once
    </style>
     
    Stomme poes, Sep 23, 2007 IP