I believe that the closest you can get is css to remove the childβs hovering style of hovering elements ... which does not help parents. Fiddle
li:hover { background-color: lightgray; } li:hover { font-weight: bold; } li:hover ul { background-color: white; font-weight: normal; }
The accepted answer to the duplicate you found is the best way I've seen to do this using javascript using e.stopPropagation: Cascading <li> -hover effect using CSS
FIDDLE response from there. You want to be more specific than the "all lis" in this selector, though.
$('li').mouseover(function(e) { e.stopPropagation(); $(this).addClass('currentHover'); }); $('li').mouseout(function() { $(this).removeClass('currentHover'); });
source share