93

In Mozilla Firefox, I want to create userContent.css which overrides the CSS of a site.

Where should I create the file (Windows 7)?

123
  1. Open Firefox and press Alt to show the top menu, then click on HelpTroubleshooting Information
  2. Click the Open Folder button beside the Profile Folder entry
  3. Create a folder named chrome in the directory that opens
  4. In the chrome folder, create a CSS file with the name userContent.css
  5. Copy the following code to userContent.css, replacing "example.com" with the website you want to modify and your own custom CSS, and restart Firefox:

    @-moz-document domain(example.com) {
        img { opacity: 0.05 !important; }
    }
    
| improve this answer | |
  • 7
    A small update / modification for step 1; the Troubleshooting Information opens up a link about:support and in my Firefox (v20 nightly build on Ubuntu) it has an entry named "Profile directory" with a button "Open Directory" which opens up the profile directory /home/tripleee/.mozilla/firefox/asdf1234.default/ in Nautilus. – tripleee Jan 3 '13 at 10:38
  • 6
    You can remove @-moz-document domain("...") to apply the style to every pages. – Nicolas May 30 '13 at 8:26
  • 5
    One small note, make sure that the folder you create is named, "chrome", with a lowercase 'c', otherwise it will not work on Linux. – Oliver Burt Dec 22 '16 at 14:04
  • 9
    It it is necessary to restart Firefox for it to take effect. – Peter Mortensen Jul 18 '18 at 8:32
  • 13
    Starting with Firefox 69, you need to set the toolkit.legacyUserProfileCustomizations.stylesheets preference to true due to bugzilla.mozilla.org/show_bug.cgi?id=1541233 – ThomasR Sep 18 '19 at 12:44
4

There was an old extension called ChromEdit, which added a simple button to easily open user CSS for editing.

This was apparently compromised or withdrawn. Stylish was an alternative, but similarly this now appears to be defunct.

At the moment you just have to remember where the file is supposed to go.

| improve this answer | |
  • I thought I'd got ChromEdit from the official list, but OK. – OrangeDog Jul 2 '15 at 19:57
  • 11
    Based on recent reviews, Stylish should probably be avoided. – KlaymenDK May 31 '17 at 8:59
  • 1
    An extension is not the same as an actual user stylesheet. That's why Chrome is worthless garbage now. – Synetech Jul 9 '17 at 23:02
  • 1
    @Synetech what are you talking about? This extension adds a button to open the stylesheet for editing. – OrangeDog Jul 9 '17 at 23:08
  • 1
    Stylish didn't work for me. When I searched for help I found a forum topic in which a user said most users of Stylish have moved to Stylus because of better user support and more continual updates. Stylus is a fork of Stylish. Stylus worked for me without the need to restart Firefox. Usage of the plug-in is simple - navigate to the page you want to style, click the app icon at top-right of your browser, choose whether you want to apply styles to the current URL only or whole domain and write your styles. When you visit again, the icon shows number of styles being applied by the plugin. – youcantryreachingme Oct 3 '18 at 23:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.