Why does a:link a:visited selector override a:hover a:active selector in CSS?

Published on

//

Most of us who are either learning CSS or trying out his very first project could face this issue. To fix this issue make sure you have all the selectors in the right order. The correct order is:

  1. a:link {}
  2. a:visited {}
  3. a:hover {}
  4. a:active {}

If you change the order of any one like a:visited to last, it will override all the other selectors.

Published in: .

Leave a Reply

Your email address will not be published. Required fields are marked *