To add a CodePen project to your Webflow site, you need to embed it using an Embed element and the proper CodePen embed code.
1. Get the Embed Code from CodePen
- Go to the CodePen page you want to embed.
- Click the "Embed" button located at the bottom right or near the top-right menu.
- Choose your preferred layout (Default, Dark Theme, etc.) in the embed settings.
- Copy the full iframe embed code provided in the "HTML" section. Make sure it starts with
<iframe.
2. Add an Embed Element in Webflow
- Open your project in the Webflow Designer.
- Drag an Embed element from the Add panel (press
A key, then find "Embed"). - Paste the iframe embed code from CodePen directly into the Embed field.
- Click Save & Close.
3. Adjust Sizing and Positioning
- Use standard Webflow styling tools to change the width and height of the embed element.
- If the embed doesn’t fully show, try setting min height on the containing div or define a height directly within the iframe tag (e.g., height="500").
4. Publish and Test
- Click Publish to push the changes to your live site.
- Visit your live URL and verify that the CodePen works and appears as expected.
Summary
To embed a CodePen into Webflow, copy the iframe embed code from CodePen’s "Embed" option and paste it into a Webflow Embed element. Style and size it as needed, publish your site, and confirm it displays properly.