首页htmlaHTML Element Style - 如何使用目标pseodo类单击锚后更改背景颜色

HTML Element Style - 如何使用目标pseodo类单击锚后更改背景颜色

我们想知道如何使用目标pseodo类单击锚后更改背景颜色。

<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
a:target {
  transition: background-color 1s ease-in;
  -webkit-transition: background-color 1s ease-in;
  -moz-transition: background-color 1s ease-in;
  background-color: yellow;
}
</style>
</head>
<body>
  <a href="#" id="see">See</a>
  <a href="#" id="works">works</a>
  <a href="#" id="well">well</a>
</body>
</html>