CSS next element (none sibling) selector -


this question has answer here:

i have html structure this:

<svg>    <path/> </svg> <img/> 

is there way "display:block;" <img/> when <path/> hovered, css only?

this possible if possible select parent of <path/> unfortunately not possible, answer not possible.

if try javascript can provide jquery (not best) example.

$('svg > path').hover(function(){    $(this).parent().next().addclass('hover'); }, function() {    $(this).parent().next().removeclass('hover'); }); 

then in css can do.

img.hover{    // these styles take effect when hover `<path>` } 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -