CSS next element (none sibling) selector -
this question has answer here:
- selecting sibling of parent 2 answers
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
Post a Comment