Remove or delete a style

There are several ways to remove a style depending on what kind of style you want to remove (class-based, id-based, or inline) and depending on whether you want to remove a style from a specific selection or from an entire Web page.

Note: Removing a style from content in a Web page removes only the reference to the style in your Web page and does not delete the style from the external or internal style sheet. You can continue to apply the same style to other content.

Because element-based styles are automatically applied to associated HTML elements, you can't remove element-based styles from particular content in a Web page. The Apply Styles task pane lists element-based styles under the heading Contextual Selectors and labels them with a blue dot. If you want to stop using an element-based style throughout an entire Web page, you can delete the style from the style sheet. If you want to stop using only some instances of an element-based style but not all, you can design a new class-based or id-based style that overrides the element-based style.

What do you want to do?

Remove one instance of a style from a Web page

Remove all instances of a style from a Web page

Remove all class-based and inline styles from a selection

Delete a style from a style sheet

Remove one instance of a style from a Web page

Note: This procedure does not apply to element-based styles.

  1. In Design view or Code view, on the Web page, select or position the cursor in the content that you want to remove the style from.

  2. In the Apply Styles task pane, point to the style that you want to remove, click the down arrow, and then click Remove Class, Remove ID, or Remove Inline Style.

Top of Page

Remove all instances of a style from a Web page

Note: This procedure does not apply to inline or element-based styles.

  1. Open the Web page in Design view or Code view.

  2. In the Apply Styles task pane, point to the style that you want to remove, click the down arrow, and then click Select All Instance(s).

  3. In the Apply Styles task pane, point to the style that you want to remove, click the down arrow, and then click Remove Class or Remove ID.

Top of Page

Remove all class-based and inline styles from a selection

  1. In Design view or Code view, on the Web page, select or position the cursor in the content that you want to remove the style from.

  2. In the Apply Styles task pane, click Clear Styles.

Top of Page

Delete a style from a style sheet

Important: Deleting a style from an external or internal style sheet doesn't remove references to that style from your Web pages. If you want to remove those references, you may find it easier to locate them by waiting to delete the style from your CSS until after you've removed the style references from your Web pages. Doing this makes it easier to identify the styled content in your Web pages.

  1. Do one of the following:

    • To delete a style from an external style sheet, either open the .css file or a Web page that the CSS is attached to.

    • To delete a style from an internal style sheet, open the Web page that contains the style.

  2. Do one of the following:

    • To delete a style from an open .css file, in the Manage Styles task pane, right-click the style, click Delete, and then click Yes in the confirmation message.

    • To delete a class-based or id-based style from an open web page, in the Apply Styles task pane, point to the style, click the down arrow, click Delete, and then click Yes in the confirmation message.

Top of Page

Share Facebook Facebook Twitter Twitter Email Email

Was this information helpful?

Great! Any other feedback?

How can we improve it?

Thank you for your feedback!

×