0

I wish to make alterations to a div named rightPanel when either itself, or another div named "plus", is hovered.

div#plus:hover, div#rightPanel:hover ~ #rightPanel {

    // make changes to rightPanel
}

(The current combinators are not working). How can I organise the precedence of the combinators to have the effect of (div#plus:hover, div#rightPanel:hover) ~ #rightPanel?

Tom Hadkiss
  • 267
  • 1
  • 7
  • 16
  • the question is #rightPanel inside #plus? what are the relation between them – DaniP Oct 23 '13 at 14:05
  • Give us the HTml please – DaniP Oct 23 '13 at 14:12
  • This issue is related to - [hover an element to change another divs styling][1] [1]: http://stackoverflow.com/questions/6910049/on-a-css-hover-event-can-i-change-another-divs-styling – ajc Oct 23 '13 at 15:59

2 Answers2

0

If I understand you correctly then, you want rightPanel to update if you hover over it, or plus - so, try:

#rightPanel:hover,
#plus:hover ~ #rightPanel{
 background-color:#ff0000;
}

it will handle the hover on rightPanel and delegate the hover over plus

web_bod
  • 5,728
  • 1
  • 17
  • 25
0

if you want to prioritize a bit of css, you can use !important - but as I'm not entirely sure what you're asking this may not answer your query.

example:

#div {
font-size:22px !important
}
DJB
  • 257
  • 2
  • 11