onei0120
onei0120

Reputation: 199

Change Link color on div hover

I have a div that has a link in it, right now if I hover over the link it chnages color, but I want to hover over the div aswell to chnage the color, here is the code:

<div class="first_product margin_right left">
<a href="/link">
</a><div class="first_product_text"><a href="/link"></a><a href="link">Automation&nbsp;<span>+</span></a></div>

</div>

Upvotes: 0

Views: 3078

Answers (2)

random guy
random guy

Reputation: 1

This should solve your problem.

CSS:

.first_product_text div:hover a {color:#HOVERCOLOUR;} 

Upvotes: 0

Adam Sweeney
Adam Sweeney

Reputation: 386

I'm all for using Jquery, but if you want to avoid it

HTML:

 <div class="first_product margin_right left">
      <div class="first_product_text">
           <a href="/link"></a>
           <a href="link">Automation&nbsp;<span>+</span></a>
      </div>
</div>​

CSS:

.first_product_text:hover{background-color:#f22;} 

heres the JsFiddle

Upvotes: 1

Related Questions