How can I integrate the code from Codepen into my Webflow page?

Published on
September 22, 2023

To integrate the code from Codepen into your Webflow page, follow these steps:

  1. Open your Codepen project and locate the HTML, CSS, and JavaScript code that you want to integrate into your Webflow page.
  2. Copy the HTML code from Codepen.
  3. In Webflow, go to the Designer and open the page where you want to add the code.
  4. Drag and drop a "Custom Code" element onto your page from the Add Panel on the left side of the Designer.
  5. Double-click on the "Custom Code" element to open its settings.
  6. Paste the HTML code that you copied from Codepen into the "Head Code" or "Body Code" section, depending on where you want the code to be placed.
  • If the code modifies the structure of your page, such as adding new elements or changing the layout, paste it in the "Body Code" section.
  • If the code only affects the styling or behavior of existing elements, place it in the "Head Code" section.
  1. Click outside the "Custom Code" element to close its settings.
  2. Copy the CSS code from Codepen.
  3. In Webflow, go to the Designer and open the page where you want to add the code.
  4. Select the element(s) on your page to which you want to apply the CSS code.
  5. In the right-side panel, select the "Styles" tab.
  6. Scroll down to the "Custom Code" section within the Styles panel.
  7. Paste the CSS code that you copied from Codepen into the appropriate section ("Before " or "Before ") within the "Custom Code" section.
  8. Click outside the element or press Enter to apply the changes.
  9. Finally, copy the JavaScript code from Codepen.
  10. In Webflow, go to the Designer and open the page where you want to add the code.
  11. Drag and drop a "Embed" element onto your page from the Add Panel on the left side of the Designer.
  12. Double-click on the "Embed" element to open its settings.
  13. Paste the JavaScript code that you copied from Codepen into the "Embed Code" section.
  14. Click outside the "Embed" element to close its settings.
  15. Preview or publish your Webflow site to see the integrated Codepen code in action.

By following these steps, you will be able to seamlessly integrate the code from Codepen into your Webflow page and enhance your design and functionality.

Additional Questions:

  1. How do I embed an external video in Webflow?
  2. Can I use custom fonts in Webflow?
  3. How do I optimize my Webflow site for SEO?