SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2002
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Hyperlink colors

    Hi,

    I have a feeling this is a very basic question but........

    I have a website where the main navigation links are one color when inactive and another when they are "hoverred" over. This is achieved by having the following at the top of my html.

    <style type="text/css">

    a {text-decoration: none; color: #FFFFFF;}

    a:hover {text-decoration: none; color: #F89428;}

    </style>

    What I would like to know is: If I have some links on the page which I want to be set at different colors to the settings above, how can I make this work?

    Thank you,
    Darren Schembri

  2. #2
    SitePoint Evangelist pip's Avatar
    Join Date
    Jun 2001
    Location
    Cape Town, South Africa
    Posts
    548
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Give the links that you would like a different color, a classname in your CSS document.

    Code:
    <STYLE TYPE="text/css">
    a {text-decoration: none; color: #FFFFFF;}
    a:hover {text-decoration: none; color: #F89428;}
    a.altLink {text-decroation: underline; color: #0000FF;}
    a.altLink:hover {text-decoration: none; color: #FF0000;}
    </STYLE>
     
    <A HREF="page.html">This is a normal link</A>
    <A HREF="page.html" CLASS="altLink">This is an alternative link</A>
    - Pip
    ---------------------------------------------------------------------------------
    Nothing takes the taste out of peanut butter quite like unrequited love.

  3. #3
    SitePoint Wizard silver trophybronze trophy Nadia P's Avatar
    Join Date
    Oct 2004
    Location
    NSW Australia
    Posts
    3,564
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Check out this tutorial.....all you want to know about this and more:
    http://www.thepattysite.com/linkstyles1.cfm

    Nadia

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    39,821
    Mentioned
    158 Post(s)
    Tagged
    4 Thread(s)
    Also check out the FAQ at the top (that's what they are there for )

    Paul


Bookmarks

Posting Permissions

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