### Creating a CSS style

You can apply a CSS style that is created directly using the properties provided in JReport Designer.

To create a CSS style in JReport Designer:

1. Right-click an object in the design area and then select Save Style from the shortcut menu to bring out the New CSS Style dialog. See the dialog.

2. Define the type of the CSS style as required:
   - To create a custom style that can be applied as a class attribute to a range or block of text, select the Class option and then enter a name for the style in the Selector Name combo box.

     Note: Class names must begin with a period and can contain any combination of letters and numbers (for example, .myhead1). If you don't enter a beginning period, JReport Designer automatically enters it for you.

   - To redefine the default formatting of a specific tag, select the Tag option and then select a tag from the Selector Name combo box.
   - To define the formatting for a particular combination of tags or for all tags that contain a specific ID attribute, select the Advanced option and then enter one or more tags in the Selector Name combo box or select one from the box.
3. Select the location in which the style will be defined in the Add Selector to Type drop-down list.
   - If you want to create an external style file, select New Style Sheet File and click OK. Then,
     1. In the Save CSS As dialog, specify the name of the new CSS file. See the dialog.

     2. Click Save to save the file and the CSS Style Definition dialog appears. See the dialog.

     3. Define the properties of the CSS file. When done, click Save to save the CSS file.
   - If you want to embed the style in an existing CSS file, select any of the existing style and click OK. Then,
     1. In the CSS Style Definition dialog, define the properties of the style as required.
     2. When done, click Save to save the file.