如何重置 Firefox 4 中的默认按钮样式
在 firefox 3.6 中,您可以使用 ::-moz-focus-inner {border:0;padding:0;margin:0;}
删除这些默认边距和填充 forms.css 添加。
如何在 Firefox 4 中重置此设置?我一直在安装目录中搜索任何可以向我的按钮添加样式的 .css 文件,但找不到 ff4 的任何文件 - 该按钮仍然有烦人的 1px 顶部填充,不允许文本垂直对齐中间。
http://easwee.net/other/FF_problem.gif
编辑:我使用重置样式表,因此无需重置样式。这是一个浏览器样式表,这里很混乱。
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.
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
EDIT: I use a reset stylesheet so no need to reset styles. It's a browser stylesheet that's messing here.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我实际上自己找到了解决方案。
在您的 url 字段中输入:
resource://gre-resources/forms.css
- 这将为 FF4 打开 forms.css - 并搜索以下选择器现在只需将其放入您的主样式表中,例如:
它不应该再覆盖你的CSS。另请注意,如果您没有为输入定义任何字体样式,FF 将不会继承正文字体样式。
I actually found the solution myself.
In your url field type:
resource://gre-resources/forms.css
- this will open forms.css for FF4 - and search for the following selectorNow just put that in your main stylesheet like:
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.
尝试将其值设置为未定义(
border:undefined
等)。这里不确定,但当我遇到类似问题时,它对我有用。try setting it's values to undefined (
border:undefined
etc). not sure here, but it worked for me when I had a similiar problem.Twitter Bootstrap 在其
reset.less
(这是normalize 的更准系统版本。 css
):顺便说一句,Bootstrap 的
reset.less
可能是比维护自己的规则更可靠、更持久的解决方案,可以实现表单跨浏览器性。它比 Meyer 的reset.css
更完整,但比normalize.css
更简约。Twitter Bootstrap does it like this in its
reset.less
(which is a more barebones version ofnormalize.css
):As an aside, Bootstrap's
reset.less
is probably a more reliable and perennial solution to achieve form cross-browser-ness than maintaining your own rules. It's much more complete than Meyer'sreset.css
, but more minimalist thannormalize.css
.只需使用 css 重置样式表,它将重置大多数浏览器的所有默认 css
http:// meyerweb.com/eric/tools/css/reset/
或阅读此 stackeoverflow 问答
https:/ /stackoverflow.com/questions/116754/best-css-reset
just use a css reset stylesheet, that will reset all the default css for most browsers
http://meyerweb.com/eric/tools/css/reset/
or read this stackeoverflow Q&A
https://stackoverflow.com/questions/116754/best-css-reset