CSS Change color on hover

前端 未结 5 1008
名媛妹妹
名媛妹妹 2021-01-23 18:54

I\'m trying to override my first \"color change\" with a second. I\'d like to have a silver color on my icon, when hover the text, and red color icon when hovering the icon.

5条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-23 19:33

    You need to style the link itself not the element around it. Add a class to the a element.

     
    

    Then you can do the following

    a.button:link{
      color:red;
    }
    
    a.button:hover{
      color:yellow;
    }
    

提交回复
热议问题