0

On <a> :hover, I need to apply some styles on div which is parent tag of <a>.

Please note I don't want to use JQuery/ Java Script, rather I need to do it using CSS/ CSS3.

JSFiddler: http://jsfiddle.net/Yawer/2p6fL/

Here is my code:

a:hover{
background-color:GRAY;

a:hover:PARENT{
border:NONE !IMPORTANT;
}

HTML:

<div style="width:200px; height:200px;border:solid 1px;">
    <span style="width:180px; height:180px;border:double 1px red;">
        <a style="border:dashed 1px green;" href="#">It is a test link</a>
    </span>
</div>

<br>
    <br>
        <div style="width:200px; height:200px;border:solid 1px;">

        <a style="border:dashed 1px green;" href="#">It is a test link</a>

</div>

Edit: The question refered here as already asked was asked in 2011, I m asking may be in this period any development has happened.

user576510
  • 5,379
  • 18
  • 74
  • 137
  • 1
    why not just select the div? – HTTP Jun 30 '14 at 06:32
  • You might not have noticed that the answers to that question are still being kept current. There is no need to ask a new question each year just to see if there have been any updates. Also, that question was asked in *2009*, which is even earlier than 2011 (I'm not sure where you got the idea that it was asked in 2011...). – BoltClock Jun 30 '14 at 06:52
  • @Jukka K. Korpela the answer you mention as earlier asked was asked in 2011, and it say not possible. I want to ask may be in this period some development has been done. – user576510 Jun 30 '14 at 06:52
  • If the situation has changed, the answer(s) to the old question (actually asked in 2009) should be updated, instead of spawning copies of the same question. And the accepted answer there has been updated “As of mid-2014”. – Jukka K. Korpela Jun 30 '14 at 08:40

1 Answers1

0

You can try this:

span:hover{
 border:NONE !IMPORTANT;
}

Demo

Pradeep Pansari
  • 1,287
  • 6
  • 10