Results 1 to 4 of 4

Thread: Link color

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    103

    Talking Link color

    I want to change the color of the links within a page. i know how to change the color of the links as a whole in the body tag, but how can a have an individual color for every link???

    please help!

    FES germany


    Is there a way to have links which aren't underlined?? how??

  2. #2
    Hyperactive Member GamerMax5's Avatar
    Join Date
    Nov 2004
    Location
    United States
    Posts
    388

    Re: Link color

    You can define different colors for links using CSS. You can make what's called classes with different attributes to apply to different links. For example, you can have an internal style that looks like this:

    HTML Code:
    <style type="text/css">
         a.className1 {color:hexValue | colorName;}
         a.className2 {color:hexValue | colorName;}
         etc...
    </style>
    Where a is the link element, .className is the name of a class that you specify, hexValue is a color value in the hexadecimal format (i.e. red = #FF0000), or you can use colorName to specify the color.

    Then when you are making your HTML, you can call the class like this:

    HTML Code:
    <a class="className" ...>
    This will apply the settings (including color) defined in the corresponding class.

    In regards to your question about not having the link underlined, you can use CSS for that as well. Again in an internal style, use the following:

    HTML Code:
    <style type="text/css">
         a {text-decoration:none;}
    </style>
    This will remove the underline from the link. Note that in this instance, you don't need to define a class to the anchor tags. This will be applied to all anchor tags you place in your HTML document. The reason your applying classes above is so you can change each link color individually.

    If this is unclear, let me know and I'll try to make it more clear for you. Hope this helps!
    Only those who try will become.

    Find me on identi.ca

    Twitter @gfmartin05

    Linux Wrap

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    103

    Re: Link color

    thanks. that works perfectly!

  4. #4
    Hyperactive Member GamerMax5's Avatar
    Join Date
    Nov 2004
    Location
    United States
    Posts
    388

    Re: Link color

    No problem. Happy I could help. ^_^
    Only those who try will become.

    Find me on identi.ca

    Twitter @gfmartin05

    Linux Wrap

Posting Permissions

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



Click Here to Expand Forum to Full Width