Skip to main content

Where to Add Custom CSS Code in Divi 5

Learn how where custom CSS code can be added in Divi 5.

Updated today

Custom CSS code can be added to various locations inside Divi 5, 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

Divi 5 Theme Options Custom CSS
  1. Go to WordPress Dashboard → Divi → Theme Options

  2. Go to the General Tab → Custom CSS

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

Divi 5 - Page Settings Advanced Tab Custom CSS
  1. Open a page built with Divi or a Theme Builder template

  2. Click on the Page Settings icon (top left corner)

  3. Go to the Advanced Tab

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

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

Divi 5 - Element's Advanced Tab Free-Form CSS

Definition:

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

  1. Open the Settings modal window of any element by clicking on the element itself or by clicking its Gear icon

  2. Go to the Advanced Tab → Custom CSS

  3. Select the Free-Form CSS tab

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

Divi 5 - Element's Advanced Tab Module Elements

Definition:

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

  1. Open the Settings modal window of any element by clicking on the element itself or by clicking its Gear icon

  2. Go to the Advanced Tab → Custom CSS

  3. Select the Module Elements tab

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

Divi 5 - Code Module with Custom CSS

Custom CSS code can be added to the Code module, wrapped in 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

Adding custom CSS code as an inline style

Divi 5 - Inline Custom CSS code

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: " " attribute.

Did this answer your question?