1. <!DOCTYPE html>
    2. <html lang="en">
    3. <head>
    4. <meta charset="UTF-8">
    5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
    6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
    7. <title>伪类</title>
    8. <style>
    9. /* 控制链接未被访问过后 */
    10. a:link {
    11. color: red;
    12. }
    13. /* 链接被访问之后 */
    14. a:visited {
    15. color: yellow;
    16. }
    17. /* 链接被激活的时候触发,鼠标按下去的时候 */
    18. a:active {
    19. color: violet;
    20. }
    21. /* 鼠标hover悬浮的时候 */
    22. a:hover {
    23. color: turquoise;
    24. }
    25. </style>
    26. </head>
    27. <body>
    28. <a href="https://www.baidu.com">百度</a>
    29. </body>
    30. </html>