01.超链接的伪类.html 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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>Document</title>
  8. <style>
  9. /*
  10. :link用来表示没访问过的链接(正常的链接)
  11. */
  12. a:link{
  13. color: red;
  14. }
  15. /*
  16. :visited 用来表示访问过的链接
  17. 由于隐私的原因,所以visited这个伪类只能修改连接的颜色
  18. (建议不要轻易修改visited的颜色)
  19. */
  20. a:visited{
  21. color: orange;
  22. }
  23. /*
  24. :hover 用来表示鼠标移入的状态
  25. */
  26. a:hover{
  27. color: aqua;
  28. font-size: 50px;
  29. }
  30. /*
  31. :active 用来表示鼠标点击
  32. */
  33. a:active{
  34. color: yellowgreen;
  35. }
  36. </style>
  37. </head>
  38. <body>
  39. <!--
  40. 1、没有访问过的连接
  41. 2、访问过的连接
  42. -->
  43. <a href="https://www.baidu.com">访问过的连接</a>
  44. <br><br>
  45. <a href="https://www.baidu123.com">没访问过的连接</a>
  46. </body>
  47. </html>