Inserting and Formatting Text > Using CSS style sheets > Applying a custom (class) CSS style |
Applying a custom (class) CSS style
Custom (class) CSS styles are the only type of CSS style that can be applied to any text in a document, regardless of which tags control the text. The CSS Styles panel displays the names of all available styles.
Do not confuse CSS styles with options such as Bold or Variable in the Text > Style submenu; these options are predefined formatting attributes that correspond to specific HTML tags.
When you apply two or more CSS styles to the same text, the styles may conflict and produce unexpected results. See About conflicting styles.
To apply a custom CSS style:
1 | Choose Window > CSS Styles. |
2 | Select the text to which you want to apply a CSS style. |
Place the insertion point in a paragraph to apply the style to the entire paragraph. | |
To specify the exact tag to which the CSS style should be applied, select the tag with the tag selector at the bottom left of the Document window. You can also select the exact tag in the tag selector, right-click (Windows) or Control-click (Macintosh) to reveal a context menu, and choose Set Class to see a list of CSS styles to apply. | |
If you select a range of text within a single paragraph, the CSS style affects only the selected range. | |
3 | Click a style name in the CSS Styles panel. |
You can also apply a CSS style by choosing a style name from the Text > CSS Styles submenu, or by right-clicking (Windows) or Control-clicking (Macintosh) and choosing the style name from the CSS Styles submenu in the context menu. The tag of the current selection appears next to the Custom Style command.