如何在 Firefox 4 + 中重置默认按钮样式 [英] How to reset default button style in Firefox 4 +

查看:23
本文介绍了如何在 Firefox 4 + 中重置默认按钮样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 firefox 3.6 中,您可以使用 ::-moz-focus-inner {border:0;padding:0;margin:0;} 删除那些默认的边距和填充 表单.css 添加.

In firefox 3.6 you could use ::-moz-focus-inner {border:0;padding:0;margin:0;} to remove those default margins and paddings forms.css added.

如何在 Firefox 4 中重置此设置?我一直在搜索安装目录中的任何 .css 文件,这些文件可以为我的按钮添加样式,但找不到任何适用于 ff4 的文件 - 按钮仍然获得令人讨厌的 1px 顶部填充,不允许文本与垂直对齐中.

How can I reset this in Firefox 4? I've been searching for any .css files inside the install directory that could add styles to my button but can't find any for ff4 - the button still gets that annoying 1px top padding that won't allow the text to align to vertical middle.

http://easwee.net/other/FF_problem.gif

我使用重置样式表,因此无需重置样式.这是一个在这里搞砸的浏览器样式表.

I use a reset stylesheet so no need to reset styles. It's a browser stylesheet that's messing here.

推荐答案

其实我自己找到了解决方案.

I actually found the solution myself.

在您的 url 字段中输入:resource://gre-resources/forms.css - 这将打开 FF4 的 forms.css - 并搜索以下选择器

In your url field type: resource://gre-resources/forms.css - this will open forms.css for FF4 - and search for the following selector

button::-moz-focus-inner,
input[type="reset"]::-moz-focus-inner,
input[type="button"]::-moz-focus-inner,
input[type="submit"]::-moz-focus-inner,
input[type="file"] > input[type="button"]::-moz-focus-inner

现在把它放在你的主样式表中,比如:

Now just put that in your main stylesheet like:

button::-moz-focus-inner,
input[type="reset"]::-moz-focus-inner,
input[type="button"]::-moz-focus-inner,
input[type="submit"]::-moz-focus-inner,
input[type="file"] > input[type="button"]::-moz-focus-inner {border:0;padding:0;margin:0;}

它不应再覆盖您的 css.另请注意,如果您尚未为输入定义任何字体样式,FF 将不会继承正文字体样式.

It shouldn't be overriding your css anymore. Also note that if you haven't defined any font style for your inputs FF won't inherit body font styling.

这篇关于如何在 Firefox 4 + 中重置默认按钮样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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