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 AtulHost

Creator of AtulHost. An ardent Linux user. Comes from a business management background. Loves to do research on modern business insights and enterprise solutions like career, education, finance, investments ideas, marketing strategies, and productivity skills; technological trends like automation, artificial intelligence, cloud and edge computing, computer hardware and networking, data science, and the internet of things.

Join the discussion

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

Ensure a friendly atmosphere to our members and visitors. Encourage the freedom of expression and exchange of information. Comments that are off-topic will be deleted.