I just saw this question Don't change link color when a link is clicked and now I'm stuck.
I have multiple links on my page, some of them with class="menuLink"
. Now only for those I want to set the colors different as a normal link. If I would just use
a:link { color:green}
a:hover { color:red }
...
this would apply to all links. But neither
.menuLink:link {color:green}
//I think because the css "doesn't know" that this class is used for links
nor
.menuLink a:link {color:green}
work. How can I achieve this?
You were close.
a.menuLink:link { color: green; }
Was what you intended to achieve. But try this:
a.menuLink { color: green; }
Would mean a a
with a classname of menuLink
, the :link
is redundant.
.menuLink a:link
Would mean a
inside of an element with a classname of menuLink
.
Have you tried:
.menuLink {color: green;}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With