Languages
[Edit]
EN

CSS - change visited link style

0 points
Created by:
Maison-Humphries
371

In this short article, we would like to show how to change the visited link style using CSS.

Quick solution:

a:visited {
  color: red; 
}

You can create your own style for links that the user has already visited using the :visited CSS pseudo-class.

Practical example

In this example, we change the color of a element to red if the user has already visited it.

// ONLINE-RUNNER:browser;

<!doctype html>
<html>
<head>
  <style>

    a:visited {
      color: red; 
    }

  </style>
</head>
<body>
  <a href="https://www.dirask.com/">Visit the link to change its style.</a>
</body>
</html>

References

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join