Styling buttons in Firefox

This is more of a note to remind me in future. Take this bit of HTML:

<button><span>Save</span></button>

If you set the button and the span to have padding: 0, Firefox will still show the button with some padding. You can get rid of this with the following CSS:

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

Sorted!
 
 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>