Cascading Style Sheets/User Style Sheets

From Wikibooks, open books for an open world
< Cascading Style Sheets
Jump to: navigation, search

CSS allows the reader of a document to apply style sheets to the document. These are called user style sheets. They become part of the cascade along with the author's style sheets.

The following sections explain how you can set your own user style sheet in various web browsers—Internet Explorer, Mozilla Firefox and Opera.

Contents

Apple Safari [edit]

Setting a user style sheet in Apple Safari:

  1. Create a style sheet and save it on a drive that can be seen by the user.
  2. Open Safari.
  3. Select Safari I Preferences... from the menus.
  4. On the Advanced tab, with the Style Sheet combo box select "Other...".
  5. Browse for the file.

The user style sheet is loaded when it is set up and when Safari is started. To avoid having to restart the program during development of the user style sheet adding the following line to the user style sheet causes it to import another style sheet whenever the page is refreshed.

@import: url("file://Path/To/Your/Stylesheet.css");

Mozilla Firefox [edit]

Setting a user style sheet in Mozilla Firefox:

  1. Find your profile by following Mozilla's instructions.
  2. Create a style sheet and save it as userContent.css in the chrome subdirectory of your profile.

Opera [edit]

Setting a user style sheet in Opera:

  1. Create a style sheet and save it on a drive that can be seen by the user.
  2. Open Opera.
  3. Select Tools>Preferences... from the menus.
  4. On the Advanced tab select Content from the list on the left.
  5. Click on the 'Styles options...' button.
  6. Fill in the 'My style sheet' box.

Windows Internet Explorer [edit]

Setting a user style sheet in Internet Explorer for Windows:

  1. Create a style sheet and save it on a drive that can be seen by the user.
  2. Open Internet Explorer.
  3. Select Tools> I nternet Options... from the menus.
  4. On the General tab click on Accessibility... (near bottom right).
  5. Under 'User style sheet' check 'Format documents using my style sheet'.
  6. Either type the location of the style sheet into the box or browse for the file.