Button not changing background color

Button not changing background color

trongarttrongart Posts: 119Questions: 22Answers: 0

In this test case, I have a button that must always have the background color yellow:

I applied the background color on its active and inactive state as well as on hover, active, and focus in css. The first time the page loads when you click on the test button and keep the mouse button pressed, the test button is grey and only turns yellow after you release the mouse button. After that, it always stays yellow.

Why is it grey on a mouse click at the page load and how can I change that?

This question has an accepted answers - jump to answer


  • kthorngrenkthorngren Posts: 14,617Questions: 25Answers: 3,469
    Answer ✓

    Run the test case then inspect the button. When clicked and held this style is applied:


    Copy all the styles in the group to override these styles. It seems to work here:


Sign In or Register to comment.