css链接样式的正确顺序

86 阅读1分钟
<style>
  a:link {
    color: blue;
  }
  a:visited {
    color: purple;
  }
  a:focus {
    color: green;
  }
  a:hover {
    color: red;
  }
  a:active {
    color: orange;
  }
  
  // 覆盖默认的样式
  a:link,
  a:visited,
  a:focus,
  a:hover,
  a:active {
      color: inherit;
      text-decoration: none;
  }
</style>