Mozilla User Stylesheets

From CSS Discuss

Jump to: navigation, search

Mozilla User Stylesheets

This page applies to Mozilla-based browsers such as Firefox. One particular use of User Stylesheets is for diagnostic purposes - see Diagnostic Css.

These browsers support user style sheets but not through the normal user interface (e.g. menus). Instead, you must place your user style sheet in a particular directory used by the browser and give it a particular name. The instructions which follow enable you to set up a browser profile that invokes a user style sheet, in addition to one that doesn't (such as the default profile). When you launch the browser, you can select which profile you want to use. You can, of course, set up multiple profiles, each with its own user style sheet.

Configuring the browser:

  1. Close the browser if it is running.
  2. Launch the browser's Profile Manager application and create a new profile. We'll call it "Diagnostics", on the assumption that you will use it to diagnose pages. Close the application without starting the browser.
  3. Search your hard drive for files like userContent*.css. There will probably be some pre-shipped examples. Amongst the search results, identify a directory whose path is like this:... \Mozilla\Profiles\Diagnostics\ ... \chrome It will probably be within the C:\Windows directory or the C:\Documents and Settings directory.
  4. Place your user style sheet in this directory and rename it userContent.css.

Maintenance Note 1: the instructions worked according to my necessarily limited testing in 2003 of Netscape 7. Firefox experts are welcome to make corrections if needed. -- Jim Wilkinson Maintenance Note 2: native support for user style sheets seems rather tortuous. There is now an add-on called Stylish which should make their use much easier. -- Jim Wilkinson

Personal tools