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 http://img192.imageshack.us/img192/5718/capturehlk.jpg and if i move my cursor to plus text highlight must be changed to yellow

2
  • Please show is some CSS too so that we can help, also Spans are by definition inline elements so this won't work unless you set the display to block or inline block... and other things too.
    – Kyle
    May 6, 2010 at 14:29
  • Ok, but it was also as general question:)
    – Le_Coeur
    May 6, 2010 at 14:38

1 Answer 1

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.