D
D
Dmax992021-07-12 19:21:03
css
Dmax99, 2021-07-12 19:21:03

How to set hover for li when hover is triggered for a?

Hello guys! Not enough knowledge, Google did not help.
How to hover the li attribute when the hover of the A attribute is triggered?

That is, an example:

#id > ul > li.class:hover {
    color:red
}
#id > ul > li.class > a:hover{
  color:red
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita Mokhovikov, 2021-07-12
@mohovoy

According to your code, the color is the same, you can just call hover li:

#id > ul > li:hover {
    color:red
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question