I am working with some links and I am using CSS to control their appearence. I have done the normal look and the a:hover look, but I have problems with the a:visited look.
When I try to put the a:visited to change the color when visited, the a:hover stops working and it stops showing the change of colors.
Does anyone know why this happens?
Your
a:visitedrule is probably after youra:hoverrule, and since they have the same specificity, the last one overrides previous ones. Simply movea:hoverto aftera:visitedand it should work. Alternatively, you could decrease the specificity ofa:visitedby changing it to:visited.See your probable problem, one possible solution by changing the order, and the alternative solution by changing the specificity.
You could also add
!importantto thecolorproperty (example) but that’s not a good idea because it will override even later and more specific ones, plus old versions of Internet Explorer don’t support it.