Css - 在创建按钮时Firefox的1个差异 [英] Css - 1 px difference in Firefox when creating a button

查看:106
本文介绍了Css - 在创建按钮时Firefox的1个差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可以在

解决方案

添加以下CSS以重置元素的填充和边框属性。



更新了JSFiddle: http://jsfiddle.net/r5vvac82/1/ p>

  .btn ::  -  moz-focus-inner {
padding:0;
border:0;
}


You can see the problem in Jsfiddle

This is my code:

CSS

   .btn {
    text-align: center;
    color: #333;
    font-weight: 700;
    font-size: 11px;
    font-family: tahoma, verdana, arial, helvetica;
    background: -webkit-linear-gradient(#fefefe, #e7e7e7);
    background: -o-linear-gradient(#fefefe, #e7e7e7);
    background: -moz-linear-gradient(#fefefe, #e7e7e7);
    background: linear-gradient(#fefefe, #e7e7e7);
    height: 24px;
    width: auto;
    overflow: visible;
    border: 1px solid #c4c4c4;
    padding: 0 10px;
    line-height: 22px;
    border-radius: 3px;
}
.btn:hover {
    color: #111;
    border: 1px solid #555;
}

HTML

<input type="submit" value="Submit" class="btn" />

This button looks OK in Chrome, Opera, MIE but not in Firefox.

In all browsers, the space above and below the "Submit" text is 7px and 7 px.

In Firefox - 8px and 6 px.

Is there any way to fix this problem in Firefox?

解决方案

Add the following CSS to reset the padding and border properties for your element.

Updated JSFiddle: http://jsfiddle.net/r5vvac82/1/

.btn::-moz-focus-inner {
    padding:0;
    border:0;
}

这篇关于Css - 在创建按钮时Firefox的1个差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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