Button not changing background color

Button not changing background color

trongarttrongart Posts: 222Questions: 51Answers: 0

In this test case, I have a button that must always have the background color yellow:
live.datatables.net/lovugevi/1/edit

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

Answers

  • kthorngrenkthorngren Posts: 21,443Questions: 26Answers: 4,974
    Answer ✓

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

    button.dt-button:active:not(.disabled):hover:not(.disabled)

    Copy all the styles in the group to override these styles. It seems to work here:
    http://live.datatables.net/lovugevi/2/edit

    Kevin

Sign In or Register to comment.