gpt4 book ai didi

Css - 创建按钮时 Firefox 中的 1 px 差异

转载 作者:技术小花猫 更新时间:2023-10-29 10:57:05 26 4
gpt4 key购买 nike

您可以在 Jsfiddle 中看到问题

这是我的代码:

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" />

此按钮在 Chrome、Opera、MIE 中看起来不错,但在 Firefox 中却不行。

在所有浏览器中,“提交”文本上下的间距为 7px 和 7px。

在 Firefox 中 - 8 像素和 6 像素。

有什么方法可以在 Firefox 中解决这个问题吗?

enter image description here

最佳答案

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

更新的 JSFiddle:http://jsfiddle.net/r5vvac82/1/

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

关于Css - 创建按钮时 Firefox 中的 1 px 差异,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33698714/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com