Animated Waves as Section Dividers in Divi

Welcome to our first Divi tutorial in 2024! We’re going to create an animated section divider using custom CSS. It’s the perfect way to add some original, animated flair to a website, and it’s easier to do than it looks!

We’ll use a Code module in the Divi Builder and an SVG generator for waves, and I’ll show you how to adjust the size, shape, and speed of the shapes and animation.

Follow along with the YouTube tutorial and copy the code snippets I used below.

And if you’d like to download a free layout with a hero section using an animated wave section divider, you can find it here. There are two versions available, both free to use!

Important!

This tutorial was streamed live inside the Divi Stylist Community, an exclusive online space for Divi Stylist Academy students. If you’d like to master professional web design and coding with live support, as well as take part in inspiring live events inside the community, check out Divi Stylist Academy.

Step 1

Create SVG Shape

You can use any vector-based graphic software to create a wavy shape, or do it online with this fun SVG Waves Generator.

Step 2

Add a New Row

Our animated divider will be located inside a separate Row. Make sure the width of the Row is set to 100% and that it’s positioned absolutely (at the top or bottom of the section). Adjust the parent section padding to accommodate the size of the divider.
Step 3

Add SVG code inside a Code module

Paste the SVG code inside a Code module and duplicate the module. The second copy will need to use position absolute with a 100%  vertical offset.

Here’s a sample code we used:

  
<svg viewBox="0 0 1664 200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<path fill="rgba(34, 34, 34, 1)" d="M 0 0 C 241 0 241 127 482 127 L 482 127 L 482 0 L 0 0 Z" stroke-width="0"></path>
<path fill="rgba(34, 34, 34, 1)" d="M 481 127 C 640 127 640 49 799 49 L 799 49 L 799 0 L 481 0 Z" stroke-width="0"></path>
<path fill="rgba(34, 34, 34, 1)" d="M 798 49 C 1023 49 1023 172 1248 172 L 1248 172 L 1248 0 L 798 0 Z" stroke-width="0"></path>
<path fill="rgba(34, 34, 34, 1)" d="M 1247 172 C 1463.5 172 1463.5 0 1680 0 L 1680 0 L 1680 0 L 1247 0 Z" stroke-width="0"></path>
</svg>

 

Step 4

Add the CSS code

Here’s a bit of CSS to define the keyframes of our animation. Edit it to match your needs:

@keyframes dl-wave {
  0% {transform: translateX(0)}
  25% {transform: translateX(-25%) scaleY(30%);}
  50% {transform: translateX(-50%) scaleY(100%)}
  75% {transform: translateX(-75%) scaleY(30%);}
  100% {transform: translateX(-100%)}
}

The code above can be placed inside the Page Settings or Free-form CSS.

And here are CSS declarations that need to target the Column with our Code modules:

animation: dl-wave 15s linear infinite;
transform-origin: top;

The code above would need to be added to the Advanced tab of the Column settings -> Custom CSS -> Main Element.

And that’s it!

I hope you liked this tutorial and found it easy to follow. What other interesting effects would you like to create with Divi and custom code? Leave me a comment below!

PS: Remember to check out Divi Stylist Academy for live access to content like this!

Have you seen our

Divi child themes?

Divi Toolbox plugin?

We offer a great selection of high-quality Divi products to speed up your work. Feel free to use a coupon code IREADBLOG at the checkout to get a 10% discount!

2 Comments

  1. Marcela

    Hi Ania, thank you for this great tutorial! I tried – on desktop, it works perfectly. However, on tablet and mobile it doesn´t. Do you have an idea how to make it work on all devices? Thank you!

    Reply
    • Ania Romańska

      Hi Marcela,
      It’s hard to say what could be the problem without seeing the issue live. As you can see on our demo page, this method should work on all screen sizes.

      Reply

Submit a Comment

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

Enjoing our content?

You might find this interesting…

License Details

REGULAR LICENSE

Single Site

A regular license allows an item to be used in one project for either personal or commercial use by you or on behalf of a client. The item cannot be offered for resell either on its own or as a part of a project. Distribution of source files is not permitted.

EXTENDED LICENSE

Unlimited Sites

An extended license allows an item to be used in unlimited projects for either personal or commercial use. The item cannot be offered for resell either on its own or as a part of a project. Distribution of source files is not permitted.

SUPPORT & UPDATES

Each license is a one-time payment. There are no annual fees. You get lifetime access to product updates. Support is provided for 6 months from the date of purchase.

Server Requirements

SERVER SETTINGS:

  • PHP 7.2 or later
  • upload_max_filesize (256M)
  • max_input_time (300)
  • memory_limit (256M)
  • max_execution_time (300)
  • post_max_size (512M)

PHP.INI SETTINGS:

  • php-xml or/and php-dom
  • XMLReader
  • PHP CURL module

PHP MODULES:

  • allow_url_fopen

Would you like to...

Consult Ania and fellow students?

Join the conversation inside our private FB group.

Would you like to...

Get support privately?

Submit a support ticket via your account page.

Ask Ania?

Submit a question for the next live Q&A session.

Consult fellow students?

Join the conversation inside our private FB group.