What is the color of a hyperlink?

hyperlink

The color of a hyperlink is typically blue, especially for unvisited links. Once clicked, the link text often changes to a different color, such as purple, to indicate it has been visited. These colors are not just aesthetic choices; they guide users intuitively while navigating a website. Customizing the hyperlink text color is possible through CSS (Cascading Style Sheets), allowing web designers to align it with their branding and design preferences.

Hex Color

The Default Colors of Hyperlinks

Blue for Unvisited Links

Traditionally, unvisited hyperlinks are displayed in a blue color, with the standard RGB value (0, 0, 238) or HEX color code #0000EE. This widely recognized color has become synonymous with clickable text, ensuring users can easily identify interactive elements on a webpage.

Purple for Visited Links

When a hyperlink has been clicked, its font color typically changes to purple. The standard for visited links is the RGB value (128, 0, 128) or HEX code #800080. This differentiation helps users remember which links they’ve already explored, improving navigation efficiency and overall user experience.

Customizing Hyperlink Colors with HTML and CSS

The HTML link color can be tailored to fit a website’s design through CSS selectors like a:link, a:visited, a:hover, and a:active. These allow developers to specify color values for various hyperlink states, enhancing both aesthetics and usability.

CSS Example for Hyperlink Styling

There are three ways to customize hyperlink colors using CSS: inline, internal, and external stylesheets. Each method has its own use cases and benefits.

Method 1: Inline CSS (Style Attribute)

Inline CSS applies styles directly to individual HTML elements using the style attribute. This is useful for one-off customizations but can become difficult to maintain across multiple links.

Example:

html

<a href="https://example.com" style="color: #0000EE;">This is an unvisited link</a>

<a href="https://example.com" style="color: #800080;">This looks like a visited link</a>

<a href="https://example.com" style="color: red; text-decoration: none;">Custom styled link</a>

Pros: Quick and easy for single links
Cons: Can’t style link states like :hover or :visited with inline styles


Method 2: Internal CSS (Style Tag)

Internal CSS is placed within a <style> tag in the <head> section of your HTML document. This affects all links on that specific page.

Example:

html

<!DOCTYPE html>
<html>
<head>
  <style>
    /* unvisited link */
    a:link {
      color: #0000EE;
    }

    /* visited link */
    a:visited {
      color: #800080;
    }

    /* mouse over link */
    a:hover {
      color: red;
      text-decoration: underline;
    }

    /* selected link (being clicked) */
    a:active {
      color: yellow;
    }
  </style>
</head>
<body>
  <a href="https://example.com">Click this link to see the styles</a>
</body>
</html>

Pros: Controls all links on one page; supports all pseudo-classes
Cons: Styles only apply to the current page


Method 3: External CSS (Separate Stylesheet)

External CSS keeps all styling in a separate .css file that can be linked to multiple HTML pages. This is the most efficient method for managing styles across an entire website.

Step 1: Create a file called styles.css:

css

/* styles.css */

/* unvisited link */
a:link {
  color: #0000EE;
}

/* visited link */
a:visited {
  color: #800080;
}

/* mouse over link */
a:hover {
  color: red;
  text-decoration: underline;
}

/* selected link */
a:active {
  color: yellow;
}

Step 2: Link the stylesheet in your HTML:

html

<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="styles.css">
</head>
<body>
  <a href="https://example.com">Your link here</a>
</body>
</html>

Pros: One stylesheet controls the entire website; easy to maintain; cleaner HTML
Cons: Requires an additional HTTP request (minimal impact)


Which Method Should You Use?

MethodBest ForUse When
Inline CSSSingle, unique linksYou need a one-time style override
Internal CSSSingle-page websitesStyles are specific to one page only
External CSSMulti-page websitesYou want consistent styling across your entire site

This level of customization enables designers to define specific text colors that harmonize with the background color of the webpage, ensuring readability and visual appeal. For most websites, external CSS is the recommended approach as it promotes consistency and makes site-wide updates simple.


Common Custom Hyperlink Colors Reference

Color DescriptionHEX CodeRGB ValueHSL ValueNamed Color
Standard Blue #0000FF rgb(0, 0, 255) hsl(240, 100%, 50%) blue
Dark Blue #00008B rgb(0, 0, 139) hsl(240, 100%, 27%) darkblue
Navy Blue #000080 rgb(0, 0, 128) hsl(240, 100%, 25%) navy
Teal #008080 rgb(0, 128, 128) hsl(180, 100%, 25%) teal
Red (Hover) #FF0000 rgb(255, 0, 0) hsl(0, 100%, 50%) red
Dark Purple #800080 rgb(128, 0, 128) hsl(300, 100%, 25%) purple
Maroon #800000 rgb(128, 0, 0) hsl(0, 100%, 25%) maroon

Default Hyperlink Color Reference Table

Link StateCSS SelectorDefault ColorHEX CodeRGB ValueHSL ValueNamed Color
Unvisiteda:linkBlue#0000EErgb(0, 0, 238)hsl(240, 100%, 47%)blue
Visiteda:visitedPurple#800080rgb(128, 0, 128)hsl(300, 100%, 25%)purple
Hovera:hoverNo defaultDesigner’s choice
Activea:activeNo defaultDesigner’s choice

Advanced Hyperlink Styling Techniques

Hover, Active, and Visited States

Using CSS, designers can adjust the appearance of hyperlinks for different user interactions:

  • :hover: Changes the text color when the user’s cursor moves over the link.
  • :active: Highlights the active link during the moment it is clicked.
  • :visited: Indicates previously clicked links.

Dynamic Colors with JavaScript

For dynamic websites, JavaScript can be used to modify the hyperlink text dynamically. This allows for personalized or context-driven changes to the font color, providing an interactive user experience.

css

Enhancing User Experience and Accessibility

Impact on User Experience

The color of the link plays a critical role in guiding users. Properly chosen hyperlink colors ensure links stand out against the background color, improving readability and user engagement. A harmonious contrast between the two is essential for maintaining clarity.

Accessibility Considerations

Accessibility in web design ensures that all users, including those with visual impairments, can navigate content easily. To make hyperlinks more accessible:

  • Include underlined text for links to distinguish them from regular text.
  • Use sufficient contrast between the link text color and the background color to accommodate users with color blindness or low vision.

Moving Beyond Blue: Creative Color Schemes

While the default blue color for hyperlinks is effective, many designers opt for custom colors to align with branding. These can be defined using color codes like HEX, RGB, or even named colors such as “teal” or “maroon.”

Inline vs. External Styles

Inline CSS: Applies styles directly within the HTML <a> tag. Example:

<a href="#" style="color: green; text-decoration: none;">Link</a>

* text-decoration: none; will remove the underline from the link.

External CSS: Separates styling from the HTML structure, enabling consistent and efficient design management across multiple pages.

telephone link website

Conclusion

The color of hyperlinks is a vital element of web design, influencing both usability and aesthetics. From the traditional blue color for unvisited links to custom schemes that incorporate specific color values, hyperlinks enhance navigation and accessibility. By leveraging tools like CSS selectors and JavaScript, developers can create engaging, visually appealing designs that prioritize user experience.

Whether you’re working with default HTML link colors or implementing advanced styling techniques, ensuring your links are both functional and accessible is key to successful web design.

FAQ

  • Anchor text vs Hyperlink
  • Why are hyperlinks traditionally blue?
  • How do I make my hyperlink blue?
  • How does hyperlink color impact SEO?
  • How do I make text into a clickable link (a hyperlink)?

Published on: 2023-11-15
Updated on: 2025-12-15

Avatar for Isaac Adams-Hands

Isaac Adams-Hands

Isaac Adams-Hands is the SEO Director at SEO North, a company that provides Search Engine Optimization services. As an SEO Professional, Isaac has considerable expertise in On-page SEO, Off-page SEO, and Technical SEO, which gives him a leg up against the competition.