Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to Prevent a Button from Changing its Border and Background Color in CSS When Clicked
<!DOCTYPE html>
<html>
<head>
<style>
.noFlash {
/* Remove onclick Background Color Change */
/* REFERENCE: https://bit.ly/2Yc95wR */
-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 */
/* REFERENCE: https://bit.ly/2KFgNG7 */
outline: none;
background-color: white!important;
}
</style>
</head>
<body>
<button class="noFlash">CLICK ME</button>
</body>
</html>
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.