Learn HTML step-by-step from A to Z or improve your professional skills.  Home HTML and CSS Tutorials Custom Link Colors
Your Ad Here

Custom Link Colors


Standard link colors are boring and frequently do not match the color scheme of your website. Pseduo-classes, which add different effects to some selectors, can change the link colors to match your site.

Custom Link Colors Example
Custom Link Colors example.

Syntax

Code:

<style type="text/css">
selector.class:pseudo-class
{
property: value
}
</style>

Now add the following in the head section of you page.(between <head> and </head>) (This is the same style I use.)

Code:

<style type="text/css">
a:link {
color: #990033;
text-decoration: none;
}
a:visited {
color: #990033;
text-decoration: none;
}
a:hover {
color: #354250;
text-decoration: underline;
}
a:active {
color: #354250;
text-decoration: none;
}
</style>

Explanation

As you see above, there are four link states: link, visited, hover, and active. The link state is for all links which the mouse is not over and has not been clicked on before. The visited state is for all links that have been clicked on before. The hover state is for all links in which the mouse is moving over. And finally, the active state is for all links that have just been clicked on or actived.

For each link state, choose a color and text-decoration. The possible values for text-decoration are none, underline, overline, line-through, and blink. Try experimenting with each value. All of the text-decoration values should be self explainatory to understand how they will change your link styles.

That's it! For custom links you do not need to apply link styles to each and every link on your page; they are applied automatically. :)



Author's URL: Depiction.net
Thank you for voting.
Rate this Materials:
Bad 
1 2 3 4 5 Excellent
print this page subscribe to newsletter subscribe to rss

HTML is Hyper Text Markup Language that is used to make hypermedia and hypertext documents for the Web. More HTML and CSS: Most Popular Materials | Fresh Materials | More HTML Tutorials at Markuptutorials.com

Add comments to "Custom Link Colors"

Only registered users can write comment

No comments yet...