Font height changes between Firefox & Webkit browsers?

被刻印的时光 ゝ 提交于 2020-01-07 04:00:23

问题


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

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?


回答1:


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;
}



回答2:


Be aware that IE 6 do not underdstands the

input[type="button"]

You have to add a class.



来源:https://stackoverflow.com/questions/8199380/font-height-changes-between-firefox-webkit-browsers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!