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

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 by Atul Kumar Pandey

Atul Kumar Pandey is a creator of atulhost. Being a business management graduate, he has a flair for business writing but also likes to dabble in technological trends. He is a voracious reader and an avid tech tester and loves to try new things.

Leave a reply

Required fields are asterisked and email address will not be shared.