htmlcssbuttonborderoutline

Unwanted outline or border around button when clicked


I have a styled button on my website. But when I click it, it creates an unwanted border or outline (I don't know which). How can I remove that border? Below is all the code that pertains to the button.

button {
    border: hidden;
    cursor: pointer;
    outline: none;
}
<button>this is my button</button>


Solution

  • If you are talking about the dotted line in Firefox, I think what you're looking for is this:

    button::-moz-focus-inner { border: 0; }
    

    This is a thread on the topic: How to remove Firefox's dotted outline on BUTTONS as well as links?