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

Hi, I'm creator of atulhost, comes from business management and tech background. I love to do research on modern business insights and latest technological solutions.

Leave a reply

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