views:

94

answers:

1

Can i change parent class of some dom object on hover event via CSS selectors? For example I have such block:

<span class="wBlock" >
   <span class="wText">Text</span>
   <span class="wLink"/>
<\/span>

and if i move mouse to span "wLink" span "wBlock" must be changed, and if i move out than it must be the same as at the begining

.wLink{
padding-right:15px;
background:url(/img/addlink.png) center right no-repeat;
cursor:pointer;
}
.wText{
    background-color: #1BE968;
}

It's something like this alt text and if i move my cursor to plus text highlight must be changed to yellow

+1  A: 

I belive you can't do that in CSS.

I would advise to restructure your HTML so you dont end up using JS hacks to apply styles.

rebus