CSS: image link, change on hover

前端 未结 8 2162
故里飘歌
故里飘歌 2020-11-29 17:48

I have an image that is a link. I want to show a different image when the user hovers over the link.

Currently I\'m using this code:



        
8条回答
  •  自闭症患者
    2020-11-29 18:31

    If you give generally give a span the property display:block, it'll then behave like a div, i.e you can set width and height.

    You can also skip the div or span and just set the a the to display: block and apply the backgound style to it.

    
    
    
        
    

提交回复
热议问题