Webflow sync, pageviews & more.
NEW

How can I properly embed a green particle animation in my Webflow site using Codepen?

TL;DR

To embed a green particle animation from CodePen into your Webflow site, follow these steps:

1. Get the CodePen Embed Code

  • Open the CodePen containing the green particle animation.
  • Click the "Embed" button in the lower right corner.
  • Copy the provided iframe embed code.

2. Add an Embed Element in Webflow

  • Go to Webflow Designer.
  • Drag an Embed element from the Add panel onto your page.
  • Paste the iframe embed code into the custom code editor.

3. Adjust iframe Size (Optional)

  • Modify the embed code to control width and height, for example:
  • <iframe height="500" style="width: 100%;" scrolling="no" src="https://codepen.io/username/embed/xyz" frameborder="no"></iframe>
  • Ensure style="width: 100%;" for responsive scaling.

4. Save and Publish

  • Click Save & Close in the Embed element.
  • Publish the site to see the animation live.

5. Alternative: Directly Add HTML, CSS, and JS

  • Copy the HTML, CSS, and JavaScript from the CodePen.
  • Open Page Settings > Custom Code in Webflow.
  • Paste the CSS inside <style>...</style> in the Header section.
  • Paste the JavaScript inside <script>...</script> in the Footer section.
  • Insert an Embed element in Designer and add the HTML inside.

Summary

The simplest way to add your green particle animation is using a CodePen iframe embed in a Webflow Embed element. For more customization, you can manually add the HTML, CSS, and JavaScript into Webflow’s Custom Code sections.

Rate this answer

Other Webflow Questions