Firefox 填充无法正常工作

Firefox padding not working properly

我有一个 button.Apply 这个 button.But 的填充与 chrome 和 Firefox

的大小不同

运行 在带有 Firefoxchrome 的片段下方,您可以看到 difference.How 来纠正问题

button{
padding:5px 15px;
}
<button>hello</button>

Firefox 版本 54.0

Chrome

请不要标记为重复。我被搜索并尝试了许多相同的问题answer.but它不起作用

谢谢,

也许你可以试试这个代码,我希望它能工作->

button {
  padding:5px 15px;
  -moz-padding:5px 15px;
}

您希望使用 Normalise CSS 来确保您的 CSS 规则在所有主要浏览器中平等且统一地应用。

这将解决您的问题。如果问题仍然存在,请在您的问题 (edit) 中明确说明您已使用 normalize 以及您可能尝试过的任何其他 CSS 修复。


i was searched and tried many of the same question answer.but its not working

准确概述您尝试过的方法。

我通过自己的方式找到了答案。Its a font problem。不同的字体系列在 chrome 浏览器上有一些默认字体大小,它与所有浏览器都不一样其他浏览器

button{
padding:5px 15px;
font-family:Arial,"Helvetica Neue",Helvetica,sans-serif !important;
}
<button>hello</button>