Back to HTML Notes
Topic #19

Link Colors

Link colours signal state to users — unvisited, visited, hover and active. Styling them properly makes navigation intuitive and your site feel polished.


An HTML link is displayed in a different color depending on whether it has been visited, is unvisited, or is active.


By default, a link will appear like this (in all browsers):

  • An unvisited link is underlined and blue
  • A visited link is underlined and purple
  • An active link is underlined and red

You can change the link state colors, by using CSS:

Example

<style>
a:link {
  color: green;
  background-color: transparent;

  text-decoration: none;
}

a:visited {
  color: pink;
  background-color: transparent;

  text-decoration: none;
}

a:hover {
  color: red;
  background-color: transparent;

    text-decoration: underline;
}

  a:active {
  color: yellow;
  background-color: transparent;

  text-decoration: underline;
}
</style>

A link can also be styled as a button, by using CSS:

Example

<style>
a:link, a:visited {
  background-color: #f44336;

  color: white;
  padding: 15px 25px;
  text-align: center;

  text-decoration: none;
  display: inline-block;
}

a:hover, a:active {

  background-color: red;
}
</style>

Note: To learn more about CSS, go to our CSS Tutorial.


Tag Description
Defines a hyperlink

Note: For a complete list of all available HTML tags, visit our HTML Tag Reference.

Want to go beyond the notes?

Join Coding Now Tech Institute's HTML course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

Link Colors – FAQs

Quick answers about learning Link Colors in HTML.

This free note from Coding Now Tech Institute explains Link Colors in HTML — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every HTML topic on Coding Now Tech Institute, including Link Colors, is 100% free with no signup required.
With focused practice, most students grasp Link Colors in 1–3 days from these notes; pairing it with Coding Now Tech Institute's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the Coding Now Tech Institute Community (/community) — expert instructors answer within 24 hours.
Call NowEnroll Now