Holly
Holly

Reputation: 1976

Having trouble keeping hyperlink style specific to one class/ id

I want to apply a different hyper link style to the following two things:

It sounds pretty simple but i can't see to get it right..

I've tried things like:

#currentpage_content a:hover{...}

and

#currentpage_content p a:hover{...}

but for some reason that applied to my navigation bar links even though they're outside #currentpage_content's div!

I also eventually figured out you could do something like this ( i think)..

#currentpage_content a.p:hover{...}

but now the link style aren't being applied at all when they should be.

Could someone please look at the bullet points above and tell me the exact syntax/order of words i need to achieve those two bullet points?

To make response easier here's the style i'm trying to apply:

a:link, a:visited, a:hover, a:active
{
font: inherit;
color: Grey;
text-decoration: none;
border-bottom: 2px solid #d4ffaa;
}
a:hover, a:active
{background-color: #d4ffaa;}

Upvotes: 0

Views: 51

Answers (2)

Oswaldo Acauan
Oswaldo Acauan

Reputation: 2740

Here is a fiddle with solution for your trouble.

Upvotes: 1

Rob d'Apice
Rob d'Apice

Reputation: 2416

#currentpage_content p a:hover, #currentpage_content h3 a:hover {
  //put your CSS in here
}

Upvotes: 3

Related Questions