CSS :visited 選擇器


使用 CSS :visited 選擇器為所有已訪問的連結設定樣式。

示例

可以嘗試執行以下程式碼來實現 :visited 選擇器

演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         a:link, a:visited {
            background-color: white;
            color: black;
            border: 1px solid blue;
            padding: 30px 30px;
            text-align: center;
            text-decoration: none;
            display: inline-block;
         }
         a:hover, a:active {
            background-color: red;
            color: white;
         }
      </style>
   </head>
   <body>
      <a href = "demo.html" target = "_blank">Demo Link</a>
   </body>
</html>

更新於: 01-Jul-2020

164 次瀏覽

開啟你的 職業

完成課程獲得認證

開始學習
廣告