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

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

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

<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#backbutton {
  display: block;
  width: 100px;
  height: 100px;
  background: red;
}

#backbutton:hover {
  background: cyan;
}

#backbutton:active {
  background: blue;
}
</style>
</head>
<body>
  <a id="backbutton" href=""></a>
</body>
</html>