App下載
首頁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>