Skip to Main Content

How to use the code module on Divi Builder

Divi: the easiest WordPress theme to use

Divi: The best WordPress theme of all time!

With over 701.000 downloads, Divi is the most popular WordPress theme in the world. It is complete, easy to use and comes with more than 62 free templates. [Recommended]

The Code Module is a blank canvas that allows you to add code to your page, such as plugin shortcodes or static HTML code. If you want to use a third-party plugin, for example a third-party slider plugin, you can simply place the plugin's shortcode in a standard or fullwidth code module to display the element unfettered.

How to add a code module to your page

Before you can add a code module to your page, you must first access the Divi Builder. Once the Divi theme is installed on your website, you will notice a button Use Divi Builder above the publisher each time you create a new page.

By clicking on this button, you activate Divi Builder, which gives you access to all the Divi Builder modules. Then click on the button Use Visual Builder to start the generator in visual mode.

You can also click on the button Use Visual Builder when you are browsing your upstream website if you are logged in to your WordPress dashboard.

button divi builder module blog divi

Once entered into Visual Builder, you can click the gray plus button to add a new module to your page. New modules can only be added inside rows. If you are starting a new page, remember to add a row to your page first.

Insert the divi code module


Locate the code module in the list of modules and click on it to add it to your page. The list of modules is searchable, which means you can also type the word "code" and then hit enter to automatically find and add the code module! Once the module is added, you will be greeted with the list of module options. These options are separated into three main groups: Contents , Design et Advanced .

Use case by adding a dull stylesheet to animate content on an individual page

In this example, I'll add a link script to import Animate.css to add animation effects to the elements on the page. Since the Animate.css file contains a lot of code, it makes sense to only load it on the page that I need.

Easily create your website with Elementor

Elementor allows you to easily create any website design with a professional look. Stop paying expensive for what you can do yourself. [Free]

Just add a regular section and a full-width line (1 column) and add the code module.

Divi builder code

In the content text box, add the code snippet.

Add the animate.css snippet

All you have to do is add a few CSS classes to animate any element of your CSS class page on your page. In this example, I'm going to bounce the button when the page loads.

In the Button module settings, on the Advanced tab, enter the two classes "animated" and "bounce" in the CSS class text box.

Add a css animate class

Are you looking for the best WordPress themes and plugins?

Download the best plugins and WordPress themes on Envato and easily create your website. Already more than 49.720.000 downloads. [EXCLUSIVE]

Now the button bounces when the page loads.

Animation of the divi builder button

Tip: Sometimes adding code with line breaks will cause the code to stop working. It is best to create your code in a text editor and paste it into the code module.

Code content options

In the content tab you will find all the content elements of the module, such as text, images and icons. All that controls what appears in your module will always be in this tab.

Divi builder code parametersContents

You can place any HTML, CSS, or JavaScript code there that you want to display on the page in the current location. Only editors and admins are allowed to post unfiltered HTML, which means code can be removed from the module if used by an author or contributor. You can also place shortcodes in the module. These course codes (shortcodes) will be displayed inside the parent column without any additional Divi module wrapper.

Administration Label

This will change the module label in the generator for easy identification. When using the WireFrame view in Visual Builder, these labels will appear in the module block of the Divi Builder interface.

Code design options

In the Design tab, you will find all the module styling options, such as fonts, colors, size and spacing. This tab allows you to modify the appearance of your module. Each Divi module has a long list of design settings that you can use to tweak just about anything.

Design option module code divi builderMaximum width

Any value entered here limits the width of any content rendered in the code module to the set value. For example, entering 50% in the input field will reduce the contents of the code module to 50% of the column that contains it.

Code Advanced Options Code

On the Advanced tab, you'll find options that more experienced web designers may find useful, such as custom CSS and HTML attributes. Here you can apply custom CSS to any of the module's many elements. You can also apply custom CSS classes and IDs to the module, which can be used to customize the module in your child theme's style.css file.

Section advance module code divi builder


Enter an easy to use CSS ID for this module. An ID can be used to create a custom CSS style or to link to particular sections of your page.

Easily create your Online Store

Download free WooCommerce, the best e-commerce plugins to sell your physical and digital products on WordPress. [Recommended]

CSS class

Enter the optional CSS classes to use for this module. A CSS class can be used to create custom CSS styling. You can add multiple classes, separated by a space. These classes can be used in your Divi Child theme or in custom CSS that you add to your page or website using the Divi theme options or the Divi Builder page settings.

Custom CSS

Custom CSS can also be applied to the module and any of the module's internal elements. In the Custom CSS section, you will find a text field where you can add CSS directly to each element. The CSS entries in these settings are already embedded with style tags. So you just have to enter CSS rules separated by semicolons.


This option allows you to control the devices on which your module appears. You can choose to deactivate your module on tablets, smartphones or desktops individually. This is useful if you want to use different modules on different devices or if you want to simplify the mobile design by eliminating certain elements from the page.

That's it for this tutorial.

This article features 0 comments

Leave a comment

Your email address will not be published. Required fields are marked with *

This site uses Akismet to reduce unwanted. Learn more about how your comments data is used.

Back To Top