O
O
Oleg2018-02-07 14:00:00
css
Oleg, 2018-02-07 14:00:00

Fix hover effect?

Good day, there is such a piece of code https://jsfiddle.net/b9m08jvg/ Is it possible to make the hover effect work only if you hover over a link in the "a" tag but not on the "ul" tag?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Ankhena, 2018-02-07
@Ankhena

Is it possible to make the hover effect work only if you hover over a link in the "a" tag, but not on the "ul" tag?

Yes, you can. It still works not on ul, but on li. And it seems to you that on ul, because pointing to a pseudo-element is considered to be pointing to the parent too, which is logical.
If necessary, when hovering over a, then rewrite this .nav-btn .nav li:before and .nav-btn .nav li:hover:before from li to a.
In order not to work when hovering over before, set it to pointer-events: none;.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question