span:hover isn't working in Firefox but works in Chrome

后端 未结 2 552
执笔经年
执笔经年 2021-01-06 03:57

I have a piece of code that I doesn\'t work in Firefox. The .icon image does not change when the button is hovered. It works perfectly in Chrome.

2条回答
  •  鱼传尺愫
    2021-01-06 04:15

    I have this solution that works on chrome and also on firefox. Why not try using FontAwesome instead of making that cart icon as image. You can see my JS Fiddle for demo. Hope this helps. Happy Coding.

    CSS:

    button{
       width: 100px;
        height: 100px;
        color: #000;
    }
    
    button:hover{
        color: red;
    }
    

    Also you can put your custom hover CSS on button:hover

提交回复
热议问题