PDA

View Full Version : Why doesn't the following HTML/CSS code work?


Ian
03-27-2007, 11:15 PM
.class1, .class1 a { color: blue; }
.class2, .class2 a { color: green; }<a href="moo.html">This link shows up as blue</a><a href="moo2.html" class="class2">This link shows up as blue even though it should be green.</a>

Irishtek
03-28-2007, 12:15 AM
your code has a style for the a tag inside the class2 class.
Your html code does not have an a tag in the class2 class.

The following code will work fine:


.class1, .class1 a { color: blue; }
.class2, .class2 a { color: green; }<a href="moo.html">This link shows up as blue</a><a href="moo2.html">This link shows up as blue even though it should be

green.</a>