How to Add Custom HTML in Squarespace
Step 1: Add a Code Block
Open the page editor, click a content insertion point (the plus icon between blocks or sections), and select Code from the block menu. If Code does not appear in the initial list, click More to see the full block library. The Code Block opens a text editor where you paste your HTML.
Step 2: Write or Paste Your HTML
Enter your HTML in the Code Block editor. Make sure the display mode is set to HTML (not Markdown) - check the toggle at the bottom of the code editor. Your HTML renders immediately in the page preview. Keep your code clean and well-indented for readability.
Step 3: Style with Custom CSS
Add CSS rules for your custom HTML elements in Design > Custom CSS. Use class names on your HTML elements (like class="custom-card") and target those classes in your CSS. This keeps your styling separate from your markup and makes both easier to maintain. For a complete CSS walkthrough, our guide to adding custom CSS to Squarespace covers selectors, properties, and responsive techniques.

Common Custom HTML Elements for Squarespace
Custom Pricing Tables
Squarespace does not include a native pricing table block. Build one with HTML using a div container with columns for each pricing tier. Each column contains the plan name, price, feature list, and a CTA button. Style with CSS Grid or Flexbox for responsive column behavior. Add hover effects and highlighted "recommended" tiers with CSS classes.
Custom Team Member Cards
While Squarespace has a basic team page layout, custom HTML lets you create team cards with unique layouts - circular photos, role badges, social media icon links, and expandable bio sections. Structure each card as a div with nested elements for image, name, title, and links.
Styled Data Tables
HTML tables let you present comparison data, specifications, schedules, and any structured information in a scannable format. Squarespace does not have a native table block, so Code Blocks are the only way to add tables. Style them with CSS for clean borders, alternating row colors, and responsive scrolling on mobile.
Custom Accordion/FAQ Sections
Build collapsible content sections using HTML details and summary elements - no JavaScript required. Each question is a <summary> element inside a <details> wrapper, and the answer content expands when clicked. Style with CSS for smooth transitions and visual consistency with your template.
Custom Call-to-Action Banners
Create attention-grabbing CTA sections with custom backgrounds, icons, and button layouts that go beyond what the standard button block offers. Use CSS gradients, box shadows, and custom padding to make your CTA stand out from surrounding content. For design principles, our Squarespace design tips guide covers visual hierarchy and conversion design.
Custom HTML vs. Squarespace Built-In Blocks
Use built-in blocks when possible. Squarespace's native blocks - text, image, button, gallery, form - are optimized for the platform. They handle responsive behavior, accessibility, and template consistency automatically. Custom HTML requires you to handle all of this yourself.
Use custom HTML when the editor cannot produce what you need. If the visual editor does not offer a block type for your design - tables, pricing grids, custom card layouts, interactive elements - Code Blocks with custom HTML are the right approach. The trade-off is more maintenance work in exchange for unlimited design flexibility.
Combine both. Use native blocks for standard content and Code Blocks for custom sections. A page that mixes Squarespace blocks with custom HTML sections looks cohesive as long as you match fonts, colors, and spacing through consistent CSS.
Making Custom HTML Responsive
Every custom HTML element must work on mobile. Fixed-width elements break on small screens. Oversized text overflows containers. Multi-column layouts need to collapse to single-column.
Use percentage widths. Set container widths to 100% or use max-width with auto margins for centered layouts. Avoid fixed pixel widths for any element that needs to adapt to mobile screens.
Use CSS media queries. Add breakpoints that adjust your layout at mobile screen widths. At 768px and below, switch multi-column layouts to single-column, reduce padding, and increase font sizes for readability.
Test on actual devices. The Squarespace mobile preview is an approximation. Open your published page on a real phone and verify that your custom HTML displays correctly, text is readable, and interactive elements are tappable. For mobile optimization strategies, our guide to Squarespace mobile optimization covers responsive design fundamentals.
Custom HTML Best Practices
Validate your HTML. Malformed HTML - unclosed tags, missing attributes, or broken nesting - can affect surrounding Squarespace content. Paste your code into an HTML validator before adding it to a Code Block.
Use semantic HTML. Use appropriate HTML elements for their intended purpose - headings for headings, lists for lists, buttons for actions. Semantic HTML improves accessibility and helps search engines understand your content structure.
Comment your code. Add HTML comments explaining what each section does. This helps you (or another developer) edit the code later without guessing what each div is for.
Keep JavaScript separate. If your custom HTML requires JavaScript, place the script in Code Injection (footer) rather than inline in the Code Block. This keeps your HTML clean and ensures the script loads in the correct order. For script management, our guide to adding custom code to Squarespace covers injection points and best practices.
Match your template's design language. Custom HTML should feel like part of your Squarespace site, not an obvious third-party element. Use the same fonts, colors, border styles, and spacing as your template. Inspect your template's CSS to find the exact values and replicate them in your custom elements. For broader design consistency, our Squarespace SEO guide covers how content presentation affects user engagement and search performance.
Frequently Asked Questions
How do I add custom HTML to Squarespace?
Do I need a specific Squarespace plan for custom HTML?
Can I add JavaScript in a Squarespace Code Block?
How do I make custom HTML responsive on Squarespace?
Can custom HTML break my Squarespace site?
Should I use custom HTML or Squarespace's built-in blocks?
How do I style custom HTML in Squarespace?
Build Custom Elements That Fit Your Squarespace Site
Custom HTML extends Squarespace beyond the visual editor's limitations. Pricing tables, data tables, team cards, FAQ accordions, and styled CTAs - any element you can build with HTML and CSS can live on your Squarespace page through a Code Block.
Start with clean, validated HTML, style it with Custom CSS to match your template, make it responsive with media queries, and test on mobile before publishing. The result is a Squarespace site that looks custom-built without leaving the platform.
* Read the rest of the post and open up an offer