Results 1 to 7 of 7

Thread: more html help. this time i want links to change colour

  1. #1
    Your very own Pikachu! Banned Peegee's Avatar
    Join Date
    Mar 2001
    Posts
    19,488
    Blog Entries
    81

    Grin more html help. this time i want links to change colour

    When you click a link, you can change its colour by setting the um...alink attribute (I think).

    What about when you hover your mouse over a link? Isn't there a (javascript or style code preferably) way to do this? What is it?

  2. #2
    Recognized Member Xander's Avatar
    Join Date
    Aug 2003
    Location
    UK
    Posts
    5,333
    Contributions
    • Former Cid's Knight

    Default

    The CSS code is similar to for the normal link you mentioned except the word hover not link. Example:

    A:hover
    { text-decoration: underline; color:#000000;


    Underline can be replaced with none, overline, etc. Hope that helps.
    rawr

  3. #3
    pirate heartbreaker The Man's Avatar
    Join Date
    Mar 2002
    Location
    Sarasota, FL
    Posts
    10,946

    Default

    This is how I did the links in my signature:

    <a href="http://216.97.98.128/forum/" style="color: #38E897; text-decoration: none;" :bou::bou::bou::bou::bou::bou::bou:over="this.style.color='#7EB7ED'; this.style.backgroundColor='#325681'; this.style.textDecoration='overline underline';" :bou::bou::bou::bou::bou::bou::bou:out="this.style.color='#38E897'; this.style.backgroundColor='transparent'; this.style.textDecoration='none';" onfocus="this.style.color='#A3D3FF'; this.style.backgroundColor='#5276A1'; this.style.textDecoration='overline underline';" onblur="this.style.color='#38E897'; this.style.backgroundColor='transparent'; this.style.textDecoration='none';">

    etc. Really really complicated because I mucked around with a bunch of different attributes that you probably won't care about, but it works.

    If you feel like mucking around with CSS, which is probably actually the best option, then do more or less what Xander said. Make sure you close your brackets though. }

    You can also add "line-through" to your list of attributes under text-decoration if you want to have the struck-through effect that links at Fool's Gold have when they're activated by clicking.
    Don't delay, add The Pimp today! Don't delay, add The Pimp today!
    Fool’s Gold tlsfflast.fm (warning: album artwork may sometimes be nsfw)

  4. #4
    ORANGE Dr Unne's Avatar
    Join Date
    Dec 1999
    Posts
    7,394
    Articles
    1
    Contributions
    • Former Administrator
    • Former Developer
    • Former Tech Admin

    Default

    Interestingly, you can specify :hover for tons of things other than just links. Table cells, divs, etc. CSS = good. Javascript = bad.

  5. #5
    Old school, like an old fool. Flying Mullet's Avatar
    Join Date
    Apr 2003
    Location
    Napping in a peach tree.
    Posts
    19,185
    Articles
    6
    Blog Entries
    7
    Contributions
    • Former Administrator
    • Former Cid's Knight
    • Former Senior Site Staff

    Default

    This url is to the middle of a stylesheet tutorial and it has the link attributes and such listed: http://hotwired.lycos.com/webmonkey/...l?tw=authoring

    If you're interested in learning about stylesheets at all this is a great tutorial to get you started.
    Figaro Castle

  6. #6
    pirate heartbreaker The Man's Avatar
    Join Date
    Mar 2002
    Location
    Sarasota, FL
    Posts
    10,946

    Default

    Originally posted by Dr Unne
    Interestingly, you can specify :hover for tons of things other than just links. Table cells, divs, etc. CSS = good. Javascript = bad.
    yes, I wouldn't be using javascript in my sig if I could create my own style sheets. Alas.
    Don't delay, add The Pimp today! Don't delay, add The Pimp today!
    Fool’s Gold tlsfflast.fm (warning: album artwork may sometimes be nsfw)

  7. #7
    Your very own Pikachu! Banned Peegee's Avatar
    Join Date
    Mar 2001
    Posts
    19,488
    Blog Entries
    81

    Grin

    Thanks everybody. I now know to call style sheets CCS (or believe I should call it CCS). Also the colours change when I hover over links

    red, blue, red, blue, red, blue (gets a seizure and dies)

Posting Permissions

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