Skip to main content
How to add Custom CSS to Divi

Divi has multiple places where Custom CSS code can be added, this guide explores all the areas for customizing through CSS code.

Updated over a week ago

Custom CSS code can be added to various locations inside Divi, such as:

  1. Theme Options

  2. Theme Builder Templates

  3. Page Settings

  4. Element's Free-Form CSS

  5. Element's Module Elements Tab

  6. Code module

  7. Child theme

  8. Inline style

Adding custom CSS code in the Theme Options

  1. Go to WordPress Dashboard → Divi → Theme Options

  2. Go to the General Tab → Custom CSS

    Divi Theme Options Custom CSS area

Notes:

  • The CSS code added to the Custom CSS section will also be synced with the Appearance → Theme Customize → Additional CSS section

  • The CSS code added to the Custom CSS section will be applied site-wide.

Adding custom CSS code using the Page Settings

  1. Open a page built with Divi or a Theme Builder template

  2. Expand the Visual Builder toolbar by clicking on the Three Dots icon

  3. Click on the Page Settings icon

  4. Go to Advanced Tab

  5. Add the custom CSS code to the Custom CSS section

    Divi Page Settings Custom CSS area

Adding custom CSS code using the element's Free-Form CSS

Definition:

  • An Element is any Section, Row, Column, or Module.

  1. Open the Settings modal window of any element

  2. Go to Advanced Tab → Custom CSS

  3. Select the Free-Form CSS tab

    Divi Element's Free Form CSS

Note:

  • When using the Free-Form CSS section, any CSS selector that will be used will start with the keyword selector.

Example:

selector h1 {
color: red;
}

Adding custom CSS code using the Module Elements tab

Definition:

  • An Element is any Section, Row, Column, or Module.

  1. Open the Settings modal window of any element

  2. Go to Advanced Tab → Custom CSS

  3. Select the Module Elements tab

    Divi's Module Elements CSS section

Important notes:

  • In this section, only CSS properties can be added, such as color: red;

  • CSS code that also includes the element's selector should be added in:

    • Theme Options → Custom CSS

    • Or in Page Settings → Advanced Tab → Custom CSS

    • Or in Element's Advanced Tab → Custom CSS → Free-Form CSS

Adding custom CSS code using the Code module

Custom CSS code can be added to the Code module, wrapped into the <style> </style> tags:

Example:

<style>
.element-selector {
color: red;
}
</style>

Adding custom CSS code in style.css of a Child Theme

You can add CSS code to the Child Theme's style.css file if you're using a Child Theme.

  1. Go to WordPress Dashboard

  2. Go to Appearance → Theme Editor

  3. Select the style.css file from the right sidebar

  4. Add the custom CSS code after the existing code

    Add custom CSS Code using a Child Theme

Adding custom CSS code as Inline Style

You can add CSS code directly to the text-based content of a Module.

  1. Open the Modal Settings window of a text-based module - for example the Text module

  2. Switch to Text Mode

  3. Add the inline style using the style: " " tag.

    Custom CSS Code using inline style tag
Did this answer your question?