字体高度在Firefox& Webkit浏览器? [英] Font height changes between Firefox & Webkit browsers?

查看:243
本文介绍了字体高度在Firefox& Webkit浏览器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

字体(myriad pro)似乎不同于Firefox& Webkit浏览器(Chrome和Safari)。我尚未在Internet Explorer上测试。

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

当我进入Firebug中的计算风格时,所有参数都是相同的行高,字体大小,填充,边距等)。我尝试将@ font-face文件隔离为一个.ttf文件类型,但没有更改。

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?

推荐答案

这是一个已知的问题,firefox给按钮添加了额外的高度,请尝试添加这个代码到css文件:

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

这篇关于字体高度在Firefox& Webkit浏览器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆