Skip to main content
All CollectionsDivi AI
How to Use the Divi Code AI
How to Use the Divi Code AI

Learn how to use Divi Code AI's capabilities to generate clean, efficient code snippets for various web elements.

Updated over 4 months ago

Divi Code AI is an innovative feature that leverages artificial intelligence to help you write, edit, and optimize code within the Divi Builder. This powerful tool simplifies the coding process, making it accessible even for those with limited coding experience while enhancing productivity for seasoned developers.

One of the things that makes Divi Code AI special is that it has been fine-tuned on the Divi module codebase, giving it an advantage over other large language models. Since it knows Divi module classes and HTML output, it can better interpret vague requests and recognize Divi terminology within your prompts.

This article will guide you through effective use of Divi Code AI to enhance your website development process.

Use the Divi Code AI to write complex CSS Code

Divi AI - Use the Divi Code AI to write complex CSS Code

  1. Open the element for which you want to apply a custom CSS code by clicking on the Gear icon

  2. Go to Advanced Tab Custom CSS Free Form CSS

  3. Click on the AI icon

  4. Write the prompt for the AI

  5. Click on the Generate Code button

Prompt example: Make the image wave like a waving hand

Use the Divi Code AI to write complex HTML Code

Divi AI - Use the Divi Code AI to write complex HTML Code

Note: HTML code should be added to the Code Module.

  1. Open the Code module's settings by clicking on the Gear icon

  2. Go to the Content Tab → Content

  3. Click on the AI icon

  4. Write the prompt for the AI

  5. Click on the Generate Code button

Prompt example: Create a large popup that fades in after 30 seconds and invites visitors to join my newsletter. Add two buttons: one purple button that links to my newsletter page and one dull gray button that says "No Thanks" and closes the popup.

Where can you use Divi Code AI?

Divi Code AI can be used in various code fields within the Divi Builder.

  1. In any Divi Element's Advanced Tab Custom CSS Free Form CSS

    Divi AI - Module Free Form CSS

  2. In any Divi Element's Advanced Tab → Custom CSS → Module Elements

    Divi AI - Module Elements

  3. In any Code Module's → Content Tab → Text → Code

    Divi AI - Code Module

  4. In the Page Settings → Advanced Tab → Custom CSS area

    Divi Ai - Page Settings Advanced Tab

Customize Any Module Using AI-Generated CSS

Divi AI - Customize Any Module Using AI-Generated CSS

Leveraging Divi Code AI within the new free-form CSS field (Advanced Tab Custom CSS Free Form CSS) allows you to easily customize any Divi element by adding customized CSS using the Divi Code AI.

Prompt example: Turn the image wrapper into a circle with a box shadow. Add a semi-transparent vibrant pink and blue gradient overlay inside the image wrapper above the element. Make the image zoom in within the wrapper using a smooth transition on hover.

Divi AI Coding Quick Actions

Divi Ai - Quick Actions

Divi Code AI comes with convenient Quick Actions that you can use to refine code. It allows you to:

  • Automatically optimize

  • Format

  • Convert Color values

  • Improve compatibility

  1. Open any module that contains HTML, JavaScript, or CSS code

  2. Click on the AI icon

  3. Choose any of the available options under the Quick Action list

  4. Wait for the chosen action to complete and click on Use This Code button

    Divi AI - Quick Actoions

Important Note: The syntax checker might flag some of the CSS rules that Divi AI Code generates as warnings (yellow warning messages), especially on vendor prefixes that are being generated. Those warnings can be safely ignored.


Additional Resources

Did this answer your question?