March 2, 2012

How to remove blue border around the button in Firefox?

Question by masato-san

I’m using Firefox 10, Windows 7 and not sure older version but when I clicked the button, the blue border appears around the button.

I created the example below.

http://jsfiddle.net/dEvKb/58/

I removed the dotted line with css below but I also do not want blue border. I can’t figure how to remove it or is it even possible to remove?

button::-moz-focus-inner,
input[type="button"]::-moz-focus-inner
{
    border: none;
    outline: none;
}

below didn’t work…

input[type="button"]:visited
{
    outline: none;
    border: none;
}

This is evil blue border I’m talking about.

enter image description here

Answer by Starx

That is the UI of Firefox, whether themed or none. Not something you got from coding.

If it is troubling you so much you can reset it and define your own style. Here is a reset rule for that.

button { background: none transparent; border: none; }

Check here

And you can add your styling on it later on. Here is a demo for that. You can define custom states for hover, visited , active like the way you want.

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!