As a quick introduction, here are the options for adding different types of code to a Squarespace site:
HTML is added in squarespace using 'Code Blocks', which are added to pages. We'll look at how to achieve this with step by step instructions in the next section.
Squarespace provides a 'Custom CSS' block that can be used to provide site-wide styling to your theme.
To inject code on a per page basis, you can add it specifically to a head tag for an individual page.
If you're in the editing section you should a menu like the following, choose 'DESIGN' from the menu.
Next select 'Custom CSS' in the design sub-menu:
Paste in the custom CSS code and click 'SAVE'. This CSS will now be available site-wide for any of your pages to use.
There's a few different ways to add HTML to Squarespace so it depends on where you want to put it, and if you want it to be repeated on all pages.
To add custom code to a page, start by selecting the 'PAGES' section from the main menu. From here, choose the page you wish to add the custom HTML to, select the section you wish to add it to and then click the 'EDIT' tab.
If you now hover over the content area you'll see some small droplets appearing, clicking one of these will allow you to add a content block to the page.
On the content block option, select code to add in some HTML.
On the next screen simply paste in your code and click save.
To add some custom code to all pages (either in the header or footer), go to the 'SETTINGS' section from the main menu. At the bottom you'll see an option 'ADVANCED' and then on the next screen is the option for 'Code Injection'. Here you will find a block where you can copy in code that will be output to the header or footer tags.
To add custom code to a specific page, go to 'PAGES', hover over the page you wish to add custom code to, and click on the 'COG' icon. On the new window, select the 'Advanced' tab. Here you can copy in and save your custom code that will be added to the 'header' tag in your source code.