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 4 of 4
  1. #1
    New Coder
    Join Date
    Nov 2002
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    hyperlinks in different colours on one page

    Hello! Can anyone tell me how I can use different hyperlink colours (with different hover, active, ... colours too if possible) in one page? I have done it before but forgot how! (Something with defining a class somewhere...)
    Thanks!

  • #2
    Senior Coder gsnedders's Avatar
    Join Date
    Jan 2004
    Posts
    2,340
    Thanks
    1
    Thanked 7 Times in 7 Posts
    CSS:
    Code:
    a:link {color: #0000ff;}
    a:visited {color: #7f7f00;}
    a:hover {color: #ff0000;}
    a:active {color: #ff0000;}
    (X)HTML
    Code:
    <a href="http://codingforums.com">CodingForums.com</a>
    Last edited by gsnedders; 06-06-2004 at 05:10 PM.

  • #3
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,718
    Thanks
    0
    Thanked 240 Times in 235 Posts
    Hi there wwwolf,

    w3schools.com should give you all the answers

    coothead

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Canada
    Posts
    253
    Thanks
    0
    Thanked 0 Times in 0 Posts
    to take care of a bunch of links....

    .special a:links {color: #0000ff;}
    .special a:visited {color: #7f7f00;}
    .special a:hover {color: #ff0000;}
    .special a:active {color: #ff0000;}

    then in your coding...

    <div class="special">
    enter links as normal in this area
    </div>

    to take care of a single link....

    a.special2:links {color: #0000ff;}
    a.special2:visited {color: #7f7f00;}
    a.special2:hover {color: #ff0000;}
    a.special2:active {color: #ff0000;}

    then in your coding...

    <a href="pagename.html" class="special2"> text here </a>


  •  

    Posting Permissions

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