-
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??
-
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! :)
-
Re: Link color
thanks. that works perfectly!
-
Re: Link color
No problem. Happy I could help. ^_^