问题描述
请参阅此code例如:
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
}
包括边框
规则是必要的按钮看起来相同的两种浏览器,而且当按钮是它消除了虚线轮廓主动
在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额外的按键间距/填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!