🔥Limited Offer: Get 50% OFFon AI & Full Stack Courses🔥
Back to HTML Notes
Topic #19

Link Colors


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 CodingNow 2.0'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 CodingNow 2.0 explains Link Colors in HTML — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every HTML topic on CodingNow 2.0, 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 CodingNow 2.0'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 CodingNow 2.0 Community (/community) — expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now