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.
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.
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 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
.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