How can I change a button's color on hover?

后端 未结 3 435
猫巷女王i
猫巷女王i 2020-11-27 06:47

I need to change the color of a button on hover.

Here is my solution, but it doesn\'t work.

a.button {
   display: -moz-inline-stack;
   display: inl         


        
相关标签:
3条回答
  • 2020-11-27 07:18

    a.button a:hover means "a link that's being hovered over that is a child of a link with the class button".

    Go instead for a.button:hover.

    0 讨论(0)
  • 2020-11-27 07:25

    Seems your selector is wrong, try using:

    a.button:hover{
         background: #383;
    }
    

    Your code

    a.button a:hover
    

    Means it is going to search for an a element inside a with class button.

    0 讨论(0)
  • 2020-11-27 07:34
    a.button:hover{
        background: #383;  }
    

    works for me but in my case

    #buttonClick:hover {
    background-color:green;  }
    
    0 讨论(0)
提交回复
热议问题