Text color change on hover over button

后端 未结 4 676
我寻月下人不归
我寻月下人不归 2021-01-12 04:29

I am trying to change the color of the text inside the button on hover.

I can make the button itself change color, but I want the button text to change color too.

4条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-12 04:52

    The CSS property color controls the text color in elements generically. In your case, to change the color on hover, use the :hover specifier;

    input[type = "submit"]:hover {
        color: #FF0000;
        //you can add more styles to be applied on hover
    }
    

    Note that you can as well specify the color using the rgb(x, y, z) format. Here's a little demo to illustrate: little link. You can play around with the demo and view the source here: another little link.

    I hope that helped!

提交回复
热议问题