How to Change Color of Hyperlinks in 3 Easy Ways

Changing the color of your hyperlinks is something that you might need to do sometimes as a Blogger or web designer and this is something that can be done in a variety of ways. A person can either specify an inline style, make an external style sheet, or specify the color change in their own style sheet.

By using any three of these methods a person can very easily change the color of their hyperlinked URLs. So without wasting much time let us tell you how to change the color of the hyperlink URL.

Steps to change the color of Hyperlink or URL

1.) To change the color of your hyperlink using inline styles you can use the following code example:

<a href="this-is-simple-test.php" style="color: #27bad9">This is a simple test</a>

The output of the above code would come out as follows:

This is a simple test

2.) To change the color of your hyperlink URL using internal CSS code you can do the following, i.e. use the following code example:

<head>
<style>
a:link {
color: #27bad9;
}
a:visited {
color: #cc0000;
}
a:hover {
color: #eeeeee;
}
</style>
</head>

The output for the above code will be visible if you paste it into the head section of your website’s HTML code.

You can change the above color codes as required by you in order to have custom color on hover as well as custom initial color for your hyperlinks.

When you have to make sure the code works on multiple pages at once, this method won’t work well, and using an external style sheet at that time is recommended for maintaining the same style throughout the pages.

See more: How to set up a short domain for WordPress posts

3.) To change the colors of your URLs or hyperlinks using an external style sheet use the below code example:

a:link {
color: #000000;
}
a:visited {
color: #cc0000;
}
a:hover {
color: #27bad9;
}

Add the above code to your Style.css file or any other external stylesheet file in order to make sure the code gives you different colored hyperlinks and you can change the color codes according to your own preference.

NOTE: A great benefit of using external stylesheet files is that the properties of all the hyperlinks can be controlled from a single place with ease and you can achieve really cool hover effects and change colors of the links when visited.

This was all regarding how to change the color of your hyperlinks on the web, to change the color of hyperlinked text in a Word file or document you need to do it differently which we will cover in a separate link later on.

Keep visiting for more awesome how-to guides, blogging tips, gadget reviews, and tech news, and remember we cover,
“Everything under the Sun!”

inspire2rise official logo

inspire2rise mascots - cowboys

Follow Inspire2rise on Twitter. | Follow Inspire2rise on Facebook. | Follow Inspire2rise on Google+.

Stay Inspired to rise fellas!

Read more:

Aditya Nath Jha is an Engineer from New Delhi, India. His areas of interest include Gadgets, WordPress, speed optimization & latest technology. When he is not busy blogging he loves to write poetry, compose his own songs and has a taste for music! Find him on Facebook, Twitter, Linked in, Instagram. And watch his videos on YouTube.



Discover more from Inspire2Rise

Subscribe to get the latest posts sent to your email.


How to Change Color of Hyperlinks in 3 Easy Ways

3 thoughts on “How to Change Color of Hyperlinks in 3 Easy Ways”

  1. Hello Aditya,

    I am glad to finally interact with you here!

    I am a complete coding noob and such coding tips are meant a world for me! Thanks for it, I gotta try them out on my blog!

    See me often!

    ~ Adeel Sami

    Reply
  2. Good article!
    It was a reminder for me to go through the style sheet of my site again, looking for stuff that I forgot.
    Guess what: I forgot to link my logo to the homepage.

    Reply

Leave a Comment