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

后端 未结 4 2117
梦谈多话
梦谈多话 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:01

    In your particular case it's easy, since #bg is a child of #hv

    Just change your hover selector from what you have to this:

    #bg:hover #hv {...}

    See my fork of your fiddle here: http://jsfiddle.net/xJSQt/

提交回复
热议问题