Applying a class style

Applying a class style

Class 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. All class styles associated with the current document are displayed in the CSS Styles panel (with a period [.] preceding their name) and in the Style pop-up menu of the text Property inspector.

You’ll see most styles updated immediately, however, you should preview your page in a browser to verify a style was applied as expected. When you apply two or more styles to the same text, the styles may conflict and produce unexpected results. For more information, see About conflicting CSS rules.

To apply a custom CSS style:

  1. In the document, 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.

    If you select a range of text within a single paragraph, the CSS style affects only the selected range.

    To specify the exact tag to which the CSS style should be applied, select the tag in the tag selector located at the lower left of the Document window.

  2. To apply a class style, do one of the following:
    • In the CSS Styles panel (Window > CSS Styles), select All mode, right-click the name of the style you want to apply, and select Apply from the context menu.
    • In the text Property inspector, select the class style you want to apply from the Style pop-up menu.
    • In the Document window, right-click (Windows) or Control-click (Macintosh) the selected text, and in the context menu, select CSS Styles and then select the style you want to apply.
    • Select Text > CSS Styles, and in the submenu select the style you want to apply.

To remove a custom style from a selection:

  1. Select the object or text you want to remove the style from.
  2. In the text Property inspector (Window > Properties), select None from the Style pop-up menu.

Related topics

  • Understanding Cascading Style Sheets
  • About the CSS Styles panel
  • Editing a CSS rule


Getting Started with Dreamweaver
Dreamweaver Basics
Working with Dreamweaver Sites
Laying Out Pages
Adding Content to Pages
Inserting and Formatting Text
Adding Audio, Video, and Interactive Elements
Working with Page Code
Preparing to Build Dynamic Sites
Making Pages Dynamic
Developing Applications Rapidly