删除在Firefox额外的按键间距/填充 [英] Remove extra button spacing/padding in Firefox

查看:115
本文介绍了删除在Firefox额外的按键间距/填充的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请参阅此code例如: http://jsfiddle.net/Z2BMK/

See this code example: http://jsfiddle.net/Z2BMK/

镀铬/ IE8看起来像这样

Chrome/IE8 look like this

火狐看起来像这样

我的CSS是

button {
    padding:0;
    background:#080;
    color:white;
    border:solid 2px;
    border-color: #0c0 #030 #030 #0c0;
    margin:0;
}

我怎样才能改变code样品使按键在两种浏览器一样的吗?我不希望使用基于JavaScript的超链接,因为它们不与键盘上的空格键工作,它都必须有一个的href URL这不是处理事情的清洁方式。

How can I change the code sample to make the button the same in both browsers? I do not want to use JavaScript based hyperlinks because they do not work with space bar on keyboard and it has to have an href URL which is not a clean way to handle things.

按钮:: - MOZ对焦,内缘{:-1px;填充:0;边框宽度:1px的; }

推荐答案

补充一点:

button::-moz-focus-inner {
    padding: 0;
    border: 0
}

http://jsfiddle.net/thirtydot/Z2BMK/1/

包括边框规则是必要的按钮看起来相同的两种浏览器,而且当按钮是它消除了虚线轮廓主动在Firefox。开发商很多摆脱这种虚线框的,可选的东西更直观友好替换它。

Including the border rule above is necessary for buttons to look the same in both browsers, but also it removes the dotted outline when the button is active in Firefox. Lots of developers get rid of this dotted outline, optionally replacing it with something more visually friendly.

这篇关于删除在Firefox额外的按键间距/填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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