Can I use img:hover to get another element?

前端 未结 5 1524
青春惊慌失措
青春惊慌失措 2021-01-25 10:33

So is it possible to make this work

#element img:hover #otherelement {...}

like

#element:hover #otherelement {...}
5条回答
  •  广开言路
    2021-01-25 11:02

    Yes it is, try:

    #element:hover + #otherelement {...}
    

    or

    #element:hover ~ #otherelement {...}
    

提交回复
热议问题