Link to home
Start Free TrialLog in
Avatar of Isabell
Isabell

asked on

a:visited is not working

Hi,

When I execute the following code, the page displays a link in red.
But it's supposed to be black first. I don't know why it follows the color in a:visited.

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <link rel="stylesheet" href="css/style.css">
  <link href="https://fonts.googleapis.com/css?family=Roboto|Roboto+Condensed&display=swap" rel="stylesheet">

  <style>
    a {
      color: black;
      text-decoration: none;
    }

    a:hover {
      color: coral;
      text-decoration: underline;
    }

    a:visited {
      color: red;
    }
  </style>
</head>

<body>
  <a href="#">Click Here</a>
</body>

</html>

Open in new window

User generated imageThis is when the page is first loaded.

Why doesn't it show the link in a black color?
ASKER CERTIFIED SOLUTION
Avatar of Anwar Saiah
Anwar Saiah

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
EXPERT CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Isabell
Isabell

ASKER

Thanks!