按钮的高度不一致(跨浏览器) [英] Button height inconsistency (cross-browser)

查看:122
本文介绍了按钮的高度不一致(跨浏览器)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有,而设置一个按钮的高度问题。基本上,我不能管理有它跨浏览器。用Firefox,它比的正常的,更高的没有任何理由。

I'm having a problem whilst setting the height of a button. Basically I can't manage to have it cross-browser. With Firefox, it is higher than normal, without any reason.

这是截图(火狐,Safari和Opera,以这个顺序):

Here it's a screenshot (Firefox, Safari and Opera, in this order):

和这里的code: http://jsfiddle.net/TMUnS/2/

我也尝试添加我在网上找到一些具体的声明,但实际上他们只是减少了高了一点,但仍,他们是不一样的(以相同的顺序):

I also tried adding some specific declarations I found on the web, but actually they just reduced the height a bit, but still, they aren't the same (in the same order):

和这里的code: http://jsfiddle.net/TMUnS/4/

我怎么能解决这个问题?

How could I fix this?

推荐答案

Firefox有这种所谓的有趣的事情 -moz-焦点内。我不完全知道什么是对的,我只知道,你有时需要做到这一点得到按钮的行为:

Firefox has this funny thing called -moz-focus-inner. I'm not totally sure what it's for, I just know that you sometimes need to do this to get buttons to behave:

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner {
    padding:0;
    border:0;
}

这可能是你所需要的。你可以在这里看到的差别(在Firefox): http://jsfiddle.net/TMUnS/9/

That might be what you need. You can see the difference here (in Firefox): http://jsfiddle.net/TMUnS/9/

这篇关于按钮的高度不一致(跨浏览器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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