1. The <a> Tag & Decoration

The <a> tag defines a hyperlink. By default, browsers add a blue color and an underline.

text-decoration

ValueMeaning
underlineDefault state
noneRemoves underline
line-throughStrikethrough

2. The :hover State

:hover is a pseudo-class. It triggers when the user's mouse moves over the element.

a {
  text-decoration: none;
  color: black;
}

a:hover {
  color: #f43f5e;
  text-decoration: underline;
}

MOUSE OVER THE LINK:

Hover Me!

3. :visited & :active

:visited

Styles links the user has already clicked.

a:visited { color: purple; }

:active

Styles the link at the exact moment it is being clicked.

a:active { color: green; }
Click and Hold Me

(Green while held down)

Combined Link Styling

In professional projects, we combine these to create a smooth user experience (UX).

/* 1. Base State */
a {
  text-decoration: none;
  color: #1e293b;
  font-weight: bold;
}

/* 2. Interaction */
a:hover {
  color: #3b82f6;
}

/* 3. Click Moment */
a:active {
  color: #ef4444;
}
Professional Link