Search code examples
cssfontscross-browserfont-face

Font height changes between Firefox & Webkit browsers?


The font (myriad pro) seems to be different between Firefox & Webkit browsers (Chrome & Safari). I have not tested on Internet Explorer.

Firefox & webkit comparison

form.standard.small input[type=submit] {
    width: 104px;
    height: 36px;
    margin: 12px 2px 4px;
    padding: 5px 27px 5px 45px;
    font-size: 14px;
    background:url('../images/button-small.png') no-repeat 0px 0px;
}

When I go into the computed style in Firebug, all parameters are the same (line-height, font-size, padding, margin, etc). I tried isolating the @font-face files to a single .ttf file type, but no change.

Anyone know why/how to fix?


Solution

  • It's a known issue that firefox adds extra height to buttons, try add this code to the css file:

    button::-moz-focus-inner, input[type="button"]::-moz-focus-inner, input[type="submit"]::-moz-focus-inner {
        padding: 0 !important;
        border: 0 none !important;
    }