How do I change image A when hovering over image B without JavaScript only CSS

后端 未结 4 2106
梦谈多话
梦谈多话 2020-12-20 06:32

I would like to know how to update image A when I hover over image B using only CSS, is it possible? if not how will I do that using only pure JavaScript (no library). But c

4条回答
  •  無奈伤痛
    2020-12-20 07:10

    To update the background position on the inner element #hv when hovering the outer element #bg, you can:

    See this Working Fiddle Example!

    #bg:hover #hv {
       ...
    }
    

提交回复
热议问题