Add a style rule

You can use the Live DOM panel to add style rules for any HTML element that has an ID or class name.

If you need to add an ID or class name to an element, see Add an element, ID, or class name.

To add a style rule for an element that has an ID

  • Do one of the following:

    • In the Style Rules panel, click Add button Create a new style rule next to the CSS file that will contain the new style rule, and then type a name for the new style rule.

    • Right-click any style rule in the Style Rules panel and select Add Style Rule Before or Add Style Rule After.

    • In the Live DOM panel, right-click the element for which you want to add a style rule, and then select Create Style Rule from Element ID.

To add a style rule for an element that has a class

  1. In the Style Rules panel, click Add button Create a new style rule next to the CSS file that will contain the new style rule, and then type a name for the new style rule.

    You can also right-click any style rule in the Style Rules panel and select Add Style Rule Before or Add Style Rule After.

    Alternatively, in the Live DOM panel, right-click the element for which you want to add a style rule, and then select Create Style Rule from Element Class.

  2. Select the class name.