
Working with the Apply Styles Window
The Apply Styles window lists all CSS style rules that are defined for a page. This includes style rules that are defined in external style sheets, as inline styles, and as styles defined in the page. Class-based and ID-based style rules appear under the name of the external .css file that contains the style. If the style rule is defined in the page, it appears under Current Page. Element-based style rules are organized the same way, but they appear under a separate heading titled Contextual Selectors.
You can set the window to list all style rules. Alternatively, you can restrict the list to only style rules that are used in the current Web page or in the current selection in the page. Regardless of which of these options that you select, element-based style rules and inline style rules appear in the window only under two conditions. One condition is when you hold the mouse pointer over page elements that use the style, and the other condition is when you select content that uses the style.
You can also sort the list of styles that appear in the Apply Styles window.
If a particular style is difficult to see against the background of the window, you can select a color to appear in the window behind styles that do not contain a background property.
Note: |
|---|
To temporarily display all the rules of a style in a pop-up window, hold the mouse pointer over the style in the
Apply Styles window.
|
An Overview of the Apply Styles Window
The user interface of the Apply Styles window has the following features:
New Style, which provides access to the Styles dialog box.
Attach Style Sheet, which lets you select a style sheet to attach to the current page.
Clear Styles, which removes all class-based and inline style rules from the current selection.
Current Page, which lists the class-based and ID-based style rules in the current page and imported external CSS files.
An external CSS file, indicated by the at sign (@), which shows all style rules that are imported into the current Web page.
An external CSS file, which is linked from the current Web page and is displayed as a separate section.
A solid rectangular border around a style, which indicates that it is used by the current selection.
Contextual Selectors, which lists element-based style rules that are used by the current selection.
Inline Style, which shows the style rules that are applied to the selected inline element.
A shortcut menu for each style rule, which enables you to perform many style-related tasks.
.png)
Using the Apply Styles Window
The Apply Styles window enables you to quickly apply a single style or multiple styles to a page element.
To apply styles to a page element by using the Apply Styles window
To display the Apply Styles window, in the Format menu, click CSS Styles, and then click Apply Styles.
In a Web page, in Design view or Source view, select the element that you want to apply a style to, and then do one of the following in the Apply Styles window:
To apply a single existing style rule, click the class or ID style that you want to apply.
To apply multiple existing style rules, press the CTRL key while you click each style that you want to apply.
You can change the order of styles, change what styles appear, and customize the window to show what you want.
To sort the styles by using the Apply Styles window
You can show or hide style rules in the Apply Styles window. Element-based styles and inline style rules appear in the Apply Styles window only when you either hold the mouse pointer over content that uses the style, or when you select content that uses the style.
To show or hide styles by using the Apply Styles window
If a style rule does not have a background color, you can apply a color that makes it easier to see the style name in the Apply Styles window. If the style has a background style rule, the background is shown with the style.
To display a color background in the Apply Style window
In the Apply Styles window, click Options, and then click Preview Background Color.
In the More Colors dialog box, select a color, and then click OK.