Show image over another image on hover

后端 未结 4 975
春和景丽
春和景丽 2020-12-16 08:03

I have the following code: JSFiddle

HTML:

4条回答
  •  轮回少年
    2020-12-16 08:35

    You can show another div on hover of parent div.

    .imageBox:hover .hoverImg {
        display: block;
    }
    

    .imageBox {
      position: relative;
      float: left;
    }
    
    .imageBox .hoverImg {
      position: absolute;
      left: 0;
      top: 0;
      display: none;
    }
    
    .imageBox:hover .hoverImg {
      display: block;
    }
    Default Image
    Profile Image

提交回复
热议问题