NewSourceMedia on Facebook

Change CSS A HREF Link Styles

Share Bookmark and Share

How to change hyperlink color styles

Question: How do I change hyperlink color style of my html links?

Answer: You can do this by adding CSS to your web page. Try the following to change the a href tages:

<style type=”text/css”>

<!—
a:link {
color: #333333;
}
a:visited {
color: #FFFFFF;
}
a:hover {
color: #CCCCCC;
background-color: #333333;
text-decoration: none;
}
a:active {
color: #333333;
}
–>

</style>

a:link is the links color
a:visited is the color for all links clicked
a:hover is the link style when your mouse hovers over the link.
A:active is the color when the link is active.

If you just want to make a simple color change to all your web links, just do:

<style type=”text/css”>

<!—
a { color: #0099ff; }
–>

</style>

In other words, all links should be #0099ff or what ever color you chose regardless if you’ve visited or are hovering over a link or not.

Please rate this post by clicking a star:

(18 votes, average: 3.89 out of 5)

3 Responses to “Change CSS A HREF Link Styles”

  • Thank you for these kind of Answer. I want to know, how to add different types of stylesheets for tag

  • Joe

    Neat little trick.

  • I like this sample as it is just what I need for my website to help me filter data with links and change the color of them once they are selected.

Leave a Reply