使用 CSS 为所有未访问的链接设置样式

cssweb developmentfront end technology更新于 2025/5/15 15:40:17

要为所有未访问的链接设置样式,请使用 CSS :link 选择器。您可以尝试运行以下代码来实现  :link 选择器:

示例

<!DOCTYPE html>
<html>
   <head>
      <style>
         a:link {
            background-color: orange;
         }
      </style>
   </head>
   <body>
      <a href = "https://www.example.com">Demo Website</a>https://www.example.com/
   </body>
</html>

相关文章


有用资源