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.

Link Colour after clicking

Discussion in 'HTML & Website Design' started by TheDutchMan, Nov 23, 2008.

  1. #1
    Hi Guys,

    I was hoping that one of you could help me out with this.

    I just made page in Dreamweaver and when I click the links the colour changes.

    What code do I need to add to determine the colour after links are clicked?

    I'm not using a CSS for this single page.

    Thanks
     
    TheDutchMan, Nov 23, 2008 IP
  2. tobydawson13

    tobydawson13 Active Member

    Messages:
    645
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
  3. Kerosene

    Kerosene Alpha & Omega™ Staff

    Messages:
    11,366
    Likes Received:
    575
    Best Answers:
    4
    Trophy Points:
    385
    #3
    You should use a:visited in your CSS, but since you're not using a CSS file, then try this:

    <a href="http://blabla.com" style="color:#cc0000">Link text</a>
    Code (markup):
    Just replace cc0000 with the colour your want. The colour should stick for visited and hover.
     
    Kerosene, Dec 7, 2008 IP
    TheDutchMan likes this.
  4. tobydawson13

    tobydawson13 Active Member

    Messages:
    645
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #4
    But that wouldn't stay the same colour after the link is visited, would it?
     
    tobydawson13, Dec 7, 2008 IP
  5. TheDutchMan

    TheDutchMan Peon

    Messages:
    374
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #5
    @ tobydawson13, looks interesting, thanks.

    @ Kerosene, I didn't knew that this was an option. thanks

    This was a double post because of a hick-up of the DP server and a other guy told me that I could copy a small piece of CSS on the top of the html and this worked for me.

    So again, thank you both. just given you both +rep's
     
    TheDutchMan, Dec 7, 2008 IP
  6. Kerosene

    Kerosene Alpha & Omega™ Staff

    Messages:
    11,366
    Likes Received:
    575
    Best Answers:
    4
    Trophy Points:
    385
    #6
    Yep. If you specify the colour in the <a> tag, then it will stay that colour, including for hover and visited.
     
    Kerosene, Dec 7, 2008 IP
  7. grunya

    grunya Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Not a good idea to have the same colour for hover as it doesn't tell a visitor that it's a link (no behaviour). Why not create an internal CSS in the head of this file where you can specify links colours for the whole page? You won't need separate css file this way.
     
    grunya, Dec 8, 2008 IP
  8. dotmd

    dotmd Peon

    Messages:
    41
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #8
    <style>

    a:visited {your-color: #here;}


    </style>
     
    dotmd, Dec 8, 2008 IP
  9. TheDutchMan

    TheDutchMan Peon

    Messages:
    374
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I have don this now. This indeed works like a charm.

    Thanks guys for the tips
     
    TheDutchMan, Dec 8, 2008 IP