Adding style sheets to Xpages

When you create or import a style sheet and add it to a application, you are ready to add it to XPages within the application. Then, you can apply style classes to XPages and controls. You can also create custom formatting and export style attributes to the style sheet.

Before you begin

About this task

To add a style sheet to an XPage, do the following steps:

Procedure

  1. Confirm that you have added a style sheet to the application by opening the Resources > Style Sheets section in the Applications Navigator.
  2. Select an XPage or control in the XPages editor.
  3. In the Properties view, open the Add Style Sheet to Page dialog box by doing either of the following steps:
    • Click the Style tab and then click Add style sheet to page.
    • Click the Resources tab and then click Add style sheet.
  4. To use a style sheet from the current application, do the following steps:
    1. Select Use style sheet from this application.
    2. To create a style sheet, click New. After you specify the name, description, location, and application for the style sheet and click OK, a script editor opens in which you can type the CSS code. When finished, click File > Save to save the new style sheet and add it to the Use style sheet from this application list in the Add Style Sheet to Page dialog box.
    3. To import a style sheet, click Import. After you specify the path to the style sheet on your local machine and provide a name (if different that the current), description, location, and application for the style sheet and click OK, the new style sheet is added to the Use style sheet from this application list in the Add Style Sheet to Page dialog box.
  5. To use an external style sheet, such as a style sheet on the Web, select Link to a style sheet from a URL and type the path to the style sheet, for example, http://www.ibm.com/style.css.
  6. Click OK.

Results

The new style sheet, including all its classes, is displayed in the Styles field and is ready to be applied to XPages and controls.