/    Sign up×
Community /Pin to ProfileBookmark

Inheritance issue, using !important, coloring links

Hey everyone,
In my stylesheet i have this –
a:link, a:visited {color:#cfb199;text-decoration:none}
a:active, a:hover {color:#9d9fa1;text-decoration:none}

but for another page link element, I was attempting to override that rule by putting a class in it’s anchor tag –
.menu-on {color:#9d9fa1}
.menu-on:hover {color:#cfb199;}

I thought that by putting a more ‘localized’ class in the element, it would override the a:link(s)

How can I override the a:link rule without using !important,

i tried !important and it works, maybe i should use that?

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@ryanbutlerSep 28.2011 — <i>
</i>.menu-on:link {color:#9d9fa1}
.menu-on:hover {color:#cfb199;}


[CODE]<a class="menu-on">blah</a>[/CODE]

That ought to do it.
Copy linkTweet thisAlerts:
@toptomatoauthorOct 02.2011 — thank-you
×

Success!

Help @toptomato spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...