Answer the question
In order to leave comments, you need to log in
How to make the background color change when hovering over a link?
I would like to implement such a thing: when you hover over a link, a gradient is applied to the background div-a. I made a simple code https://jsfiddle.net/destroer18/oxeum1or/ so as not to throw off the whole one.
Answer the question
In order to leave comments, you need to log in
HZ, maybe a jQuery example for your case is suitable:
$('li a.h').hover(function() {
$('.nav').toggleClass('hovered');
});
As you wrote, it cannot be done. To change the background of the parent element when hovering over a link. css doesn't have this option.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question