Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reset default button style in Firefox 4 +

Tags:

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.

like image 444
easwee Avatar asked Mar 28 '11 13:03

easwee


People also ask

How do I turn off styles in Firefox?

Click "View" on the toolbar, select "Page Style" and click "No Style" in the resulting sub-menu to disable the stylesheets. The stylesheets are disabled immediately.

How do I reset my Firefox profile?

#*If you're unable to access the Help menu, type '''about:support''' in your address bar to bring up the Troubleshooting Information page. #At the top right corner of the page, you should see a button that says "Refresh Firefox" ("Reset Firefox" in older Firefox versions). Click on it. #Firefox will close.

What is the default Firefox font?

Fira Sans is the typeface used in Firefox web products. Despite Open Sans being used on some Mozilla web properties, it is currently not recommended for Firefox products. Roboto is the standard typeface on Android.


2 Answers

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 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;} 

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.

like image 167
easwee Avatar answered Sep 17 '22 17:09

easwee


try setting it's values to undefined (border:undefined etc). not sure here, but it worked for me when I had a similiar problem.

like image 23
wildcard Avatar answered Sep 17 '22 17:09

wildcard