Jump to content

a:link{}


watagal

Recommended Posts

GreetingsI need to have 2 a:link{} (a:visited{}, a:hover{}, etc.) entries in my external CSS file - one for light backgrounds and another for dark backgrounds. I been to w3school and could not find how to do this.I've tried: a.darkbg:link{} and a:link.darkbg{} - not working.As you can tell, I'm new at this - so if someone can give me a hint, I'll be on my way.Gal

Link to comment
Share on other sites

I found pseudo classes at w3schools, here's what I have in my CSS file:

a.darkbg:link   {color:white;text-decoration:none}a.lightbg:link   {color:black;text-decoration:none}

and in my PHP file I have:

print '<a class="lightbg" href="'.$ilink[$i].'"> '.$title[$i].'<br></a>';

and I get white text on a light background.Thanks,Gal

Link to comment
Share on other sites

I got it. Sorry for the silly question.It turns out you need to define all 4 pseudo classes (link, visited, active, hover) for both the 'darkbg' and lightbg' classes. In my haste I was testing just short of that.Thanks, Gal

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...