How to Use Custom Code on Carrd
Use Carrd's Embed element to add custom HTML, CSS, or JavaScript: select Embed, paste code, set Style to Inline for visible content or Hidden (Head/Body End) for styles/scripts, then publish to view. Requires Pro plan; test code first and check console for errors. Common for third-party widgets or custom features.
Prerequisites
- Carrd Pro Standard or higher plan
- Valid HTML/CSS/JavaScript code tested standalone
- Browser with developer tools (e.g., Chrome console)
- Basic JavaScript knowledge
- Published site (not preview)
Step-by-Step Instructions
Open Carrd Dashboard and Page Editor
Add Embed Element
Configure Embed for Custom Code
Code if prompted, then paste your custom code into the Code input field.[4]Embed HTML Snippets
Inline, which displays the content visibly where the element is placed on the page.[1][4]Embed Custom CSS
<style> tags. Set Style to Hidden and Location to Head for global styles.[1][4]Embed JavaScript
<script> tags. Set Style to Hidden and Location to Body End to run after page load.[1][3][4]Toggle Style and Location
Inline (visible, direct page impact) and Hidden (background execution). Adjust Location as needed: Head, Body Top, or Body End for Hidden.[1][4]Save and Apply Changes
Publish to Test
.carrd.co or Custom Domain, then Publish Changes. Custom code won't show in editor preview—test on live site.[1][4]Set Up Custom Form Code (Optional)
Custom, paste JS in Code using this for form reference. Return true/call success() for success.[2]Common Issues & Troubleshooting
Site loads blank or broken after adding code
Invalid JS syntax (e.g., missing semicolon); validate code in standalone HTML, check browser console (F12) for errors, publish site, use try-catch wrappers.[1][3]
Code doesn't appear or work in editor
Custom code only renders on published live site, not previews; always publish and test live.[1][4]
Performance issues or slow loading
Heavy/unoptimized scripts; minify code, use async/defer, isolate in test site, check Network tab in console.[1][3]
Form submission errors
Duplicate IDs or fixed values; ensure unique IDs, return true/success() or false/failure() properly.[2]
ReferenceError or mixed content issues
Script loading order or HTTP/HTTPS mismatch; set to Body End, use HTTPS sources, debug console for specifics.[1][3]