Link

Status: experimental

Anatomy

State

  • link (default)
  • unvisited (default)
  • visited
  • active
  • hover
  • focus

API

Class names

nih-link
nih-link--active
nih-link--visited
nih-link--unvisited
nih-link--hover
nih-link--focus

Technology

  • Use the a:link, a:active and a:visited pseudo states in CSS.

Visual design

  • Using the color "red" might indicate an error, so you might want to avoid that.
  • Using the color "maroon" might indicate a link to a non-existing page, because Wikipedia does that. So you might want to avoid that.
  • The color of an embedded icon should in some cases take on the color of the link, so the icon color could change depending on the state of the link.

Considerations:

  • Focus ring visibility: Does a distinct visual style for the focus state distract from recognizing the focus ring?

  • Is it recommended to have a distinct style for the focus state, or is the default focus ring sufficient?

    For example: switching from non-underlined to underlined text might not be very visible when the focus ring overlaps the underline.

Example

Default link, unvisited: Example link
Visited link: Example link
Active link: Example link
Link on hover: Example link
Link on focus: Example link