0

Fiddle — just open it in Chrome and Firefox, all latest.

There is .button class in my CSS — I use it for all kind of buttons: a.button, button.button, etc.

As you see, there are no difference in Chrome between button.button and any other *.button elements. As you see in FF — button.button is slightly bigger than any other *.buttons.

How can I made FF to render any buttons properly, like Chrome do?

UPDATE: This is absolutely not a duplicate of any post on SO.

StackOverflow asks for a code:

.button {
    font: normal 100% Arial, sans-serif;
    position: relative;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    color: #00f;
    background-color: transparent;
    border: 1px solid #00f;
    border-radius: 3px;
    user-select: none;
    outline: 0;
    cursor: pointer;
    white-space: nowrap;
}

.button_medium {
    padding: 0 12px;
}

.button__text {
    font-weight: 400;
    display: inline-block;
    line-height: 1;
    vertical-align: top;
    white-space: nowrap;
}

.button__text_medium {
    font-size: 90%;
    line-height: 28px;
    letter-spacing: -1px;
}
<div style="padding:5em;">
    <button class="button button_medium" type="button">
        <span class="button__text button__text_medium">Save</span>
    </button>

    <label class="button button_medium">
        <span class="button__text button__text_medium">Save</span>
    </label>

    <span class="button button_medium">
        <span class="button__text button__text_medium">Save</span>
    </span>

    <a class="button button_medium">
        <span class="button__text button__text_medium">Save</span>
    </a>
</div>
artuska
  • 864
  • 2
  • 12
  • 23
  • possible duplicate of [Remove extra button spacing/padding in Firefox](http://stackoverflow.com/questions/5517744/remove-extra-button-spacing-padding-in-firefox) – Bass Jobsen Nov 22 '14 at 14:11
  • No, this is absolutely not a duplicate — just open your link an read what is written there. – artuska Nov 22 '14 at 14:17

1 Answers1

1

Have you tried? AFAIK it is really a duplicate. See also: http://css-tricks.com/forums/topic/button-padding-issue/

The following code will fix your issue:

button::-moz-focus-inner {
padding: 0 !important;
border: 0 none !important;
}
Bass Jobsen
  • 48,736
  • 16
  • 143
  • 224
  • OMG, I really have tried to put &::-moz-focus-inner {...} in .button classes and it does not worked for me in SASS with Autoprefixer. So, it seems Autoprefixer have cut -moz rule. Aaaargh! – artuska Nov 22 '14 at 15:05