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 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jul 2005
    Location
    Guildford, UK
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts

    changing color of a link

    hi,

    i am trying to change the colour of a link using onmouse, trouble is the colour starts off as blue, changes when i go over then goes to black when i roll off.
    where do i change the colour of the link?

    cheers

  • #2
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    a:link {color: #00F;}
    a:active {color: #00F;}
    a:hover {color: #000;}
    a:visited {color: #00F;}

  • #3
    Regular Coder
    Join Date
    Jul 2005
    Location
    Halifax, Nova Scotia, Canada
    Posts
    392
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Replace the 'whatevers' with the attribute you wish such as color. Ensure that they are declared in this order.


    A:link {
    whatever
    }

    A:visited {
    whatever
    }

    A:hover {
    whatever
    }

    A:active {
    whatever
    }
    Once I thought I was wrong but I was mistaken.

  • #4
    Regular Coder
    Join Date
    Jul 2005
    Location
    Guildford, UK
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks guys

  • #5
    Regular Coder
    Join Date
    Nov 2004
    Location
    The Netherlands
    Posts
    551
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can shorthand this.
    Code:
    a {
      color: #000;
      text-decoration: underline
    }
    /*the foucs pseudo element is for users that navigate with tab*/
    a:hover, a:focus {
      color: #c00;
      text-decoration: none
    }
    The style is up to you
    CATdude about IE6: "All your box-model are belong to us"


  •  

    Posting Permissions

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