Firefox 上的按钮太高
我遇到了 Firefox 特有的问题。我正在尝试设置链接和按钮的样式,使其看起来完全相同。在除 Firefox 之外的所有浏览器上,这都可以按预期工作。在 Firefox 上,按钮内容的高度为 18 像素,而链接的高度为 15 像素。在 Chrome、Safari 和 Internet Explorer 上,它们的高度均为 15 像素。这是为什么呢?
这是关于 jsFiddle 的演示 该问题。这是我在 Chrome 上得到的结果:
这是 Firefox 的结果:
我尝试在 CSS 中手动更改高度,但这并不完全有效,并且会破坏其他浏览器上的布局。设置 -moz-appearance: none 不会执行任何操作,但话又说回来,通常不会执行任何操作。
这是我尝试的完整细节 以及它的用途。
以前有人遇到过这个问题吗?如何使所有浏览器的高度相等?
I've got a problem unique to Firefox. I'm trying to style links and buttons to look exactly the same. On every browser except Firefox, this works as desired. On Firefox, the height of the button's content is 18 pixels, compared to 15 pixels for the link. On Chrome, Safari, and Internet Explorer, they're both the proper 15 pixels tall. Why is this?
Here's a demo on jsFiddle of the problem. Here's the result I get on Chrome:
and here's the Firefox result:
I've tried changing the height manually in CSS, but that doesn't entirely work and breaks the layout on other browsers. Setting -moz-appearance: none
does nothing, but then again, it usually doesn't.
Here's a full detail of my attempt, too, and what it's going to be used for.
Has anyone come across this problem before? How can I equalize the height across all browsers?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
找到另一个使用此的用户:
http://jsfiddle.net/MCAllinder/dehda/2/
Found another user who used this:
http://jsfiddle.net/MCAllinder/dehda/2/
我找到了一个完整的解决方案并在这里写了它:
http://davidwalsh.name/firefox-buttons
您需要修改 margin-top 和 margin-bottom 以匹配您的其他按钮
I've found a complete solution and wrote about it here:
http://davidwalsh.name/firefox-buttons
You need to modify the margin-top and margin-bottom to match your other buttons