Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
How to Prevent a Button from Changing its Border and Background Color in CSS When Clicked
<!DOCTYPE html>
.noFlash {
/* Remove onclick Background Color Change */
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: transparent;
.noFlash:focus {
/* Remove onclick Border Color Change */
outline: none;
background-color: white!important;
<button class="noFlash">CLICK ME</button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.