Hello. I am trying to learn CSS/XHTML on my own. I have downloaded the CSS and HTML code for a furniture web page so I can play around with it and see what happens. The web site has a list with 30 manufacurers and links to their web sites. When I try to change the color specified in a:link (in the CSS style sheet), not all of the listed manufacturer links will change. This happens even though I did not change anything else in either the HTML or CSS codes. If I put the original color back into the a:link, all the manufacturer links will return to that color and everything works as designed. Can anyone explain to me why this is happening and how do I correct it? Thanks in advance for any help and insights you might provide.

  • Here is the CSS code: a:link {color: #945ca6;text-decoration:none;} a:visited {color: #945ca6;text-decoration:none;} a:hover {color: #949494;text-decoration:underline;} a:active {color: #949494;text-decoration:underline;} When I change the color in a:visited, the some manufacturers default immediately to the new color. Again, once the original color is re-entered, everything works. Here is an example of how the manufacturers are listed in HTML: Abco - <a target="_blank" href="http://www.abcofurniture.com">www.abcofurniture.com</a> Thanks for your interest in my problem confusedwebguy almost 6 years ago

2 answers

0
points

Does by chance have to do with the site being visited? Try setting an a:visited style. Can you post the css?

Answered almost 6 years ago by Trevor Landau
  • Here is the CSS code: a:link {color: #945ca6;text-decoration:none;} a:visited {color: #945ca6;text-decoration:none;} a:hover {color: #949494;text-decoration:underline;} a:active {color: #949494;text-decoration:underline;} When I change the color in a:visited, the some manufacturers default immediately to the new color. Again, once the original color is re-entered, everything works. Here is an example of how the manufacturers are listed in HTML: Abco - <a target="_blank" href="http://www.abcofurniture.com">www.abcofurniture.com</a> Thanks for your interest in my problem confusedwebguy less than a minute ago confusedwebguy almost 6 years ago
Sisira 95
0
points

The order of the global link declaration should be in the following order

a:link              { color:red; text-decoration:underline; }
a:visited           { color:red; text-decoration:underline; }
a:hover             { color:green; text-decoration:underline; }
a:active            { color:red; text-decoration:underline; }

if you want to change for a specific manufacturer link which have a class "manufacturer1", then you can out as follows.

a.manufacturer1:link    { color:red; text-decoration:none; }
a.manufacturer1:visited { color:red; text-decoration:none; }
a.manufacturer1:hover   { color:green; text-decoration:underline; }
a.manufacturer1:active  { color:red; text-decoration:none; }

For more information visit the following

http://www.w3.org/TR/CSS2/selector.html#dynamic-pseudo-classes

Answered almost 6 years ago by Sisira
  • Here is the CSS code: a:link {color: #945ca6;text-decoration:none;} a:visited {color: #945ca6;text-decoration:none;} a:hover {color: #949494;text-decoration:underline;} a:active {color: #949494;text-decoration:underline;} When I change the color in a:visited, the some manufacturers default immediately to the new color. Again, once the original color is re-entered, everything works. Here is an example of how the manufacturers are listed in HTML: Abco - <a target="_blank" href="http://www.abcofurniture.com">www.abcofurniture.com</a> Thanks for your interest in my problem confusedwebguy less than a minute ago confusedwebguy almost 6 years ago
  • I think you are adapting the correct approach. For proper testing, you should delete the browser cache first and then put the actual href value in anchor instead of simple "#". I have tested with different url value and it's working as required. Sisira almost 6 years ago