Squarespace is a powerful and easy way to build a website. It lets you do all sorts of fancy things without writing a single line of code, which is amazing! But, there are some limitations to what you can achieve using the Squarespace blocks and Site Style editor.
That’s where custom code is going to come in super handy. I know that coding can be intimidating for most people. But, I promise you that this guide will be as easy as pie! You won’t actually be “coding” but copying and pasting what I’ve prepared for you.
This is perhaps the number one piece of custom code that most Squarespacers learn to use. The ability to configure absolutely any font your little heart desires is priceless. It gives you more creative freedom to ensure your site aligns perfectly with your brand. Plus, it’s a total walk in the park.
Copy and paste this piece of code into the Custom CSS window that you already have open:
@font-face {
font-family: ‘NAME OF FONT HERE’;
src: url(FONTURLHERE); }
Copy and paste this piece of code into the Custom CSS window that you already have open:
h1 { font-family: ‘NAME OF FONT HERE’, sans-serif; }
And you’re done!
Now, whenever you are writing in a text block on your site and you select “Heading 1”, this font will be used.
Tip: Want to change the font for Heading 2 and Heading 3? Use the same method above but change “h1” to “h2” or “h3”. Easy!
Another simple and genius way to jazz up your site is to use an FAQ accordion. This is a super clever way to lay out all of the text in your question and answer section without it looking like a long, boring block of text.
The FAQ accordion code has been floating around the internet for awhile. However, I found after using it on my site there was a little bug in it. Whenever there were too many questions clicked “on” to reveal the answer, the bottom of the section was obscured by a black strip (the background showing through).
This meant that if my user clicked to read more than three or four questions, by the time they reached the bottom of the page they weren’t able to see the text!
One of the reasons I’m a bit of a nerd about CSS is the joy I get fixing issues like this with a couple of lines of code! I played around with a few options but settled on configuring the accordion to only allow one question to be open at a time.
When my user is finished reading one answer and they click on the next question, the previous question will toggle off (close).
This means that only one question can be opened at a time. This solved the problem of the background showing through and made the page more user friendly! CSS for the win!
Let me show you how you can use an FAQ accordion with the automatic toggle off feature on your page.
<script type=”text/javascript” src=”//ajax.googleapis.com/ajax/libs/
jquery/1/jquery.min.js”></script>
<script> $(document).ready(function(){
$(‘.markdown-block .sqs-block-content h3’).css(‘cursor’,’pointer’);
$(“.markdown-block .sqs-block-content h3”).nextUntil(“h3”).
slideToggle();
$(“.markdown-block .sqs-block-content h3”).click(function() {
$(this).siblings().not(“h3”).not($(this).nextUntil(“h3”)).slideUp();
$(this).nextUntil(“h3”).slideToggle();
}); }); </script>
### + Question 1?
Answer Here
### + Question 2?
Answer Here
### + Question 3?
Answer Here
That’s it! Enjoy your snazzy new FAQ accordion!
I love to get selective about which colour I want each of my buttons to be on individual sections. However, the Squarespace style editor only allows you to apply a primary and an alternative colour to each button size.
CSS to the rescue!
Every Squarespace block, when installed on a page, is given a special ID which allows us to target it with CSS. First, we need to find out what the Block ID is for your button.
#YOURBLOCKID .sqs-block-button-element–SIZE {background-color: #000000;}
All done! Simply refresh your page to check it has worked correctly. This code can be used over and over for as many buttons as you like.
Tip: Be careful to select the right button size as the code won’t work if your button is a different size than you entered in your CSS.
Enjoy your pretty new buttons!
Squarespace does an absolutely brilliant job of making websites mobile responsive without you needing to do much at all. However, you may have noticed some sections or pages don’t look quite right on smaller devices. I find the main culprits of this problem are spacer blocks.
On a desktop/laptop screen, spacer blocks are invaluable for laying out and organising your content. However, on a mobile where the screen real estate is much more valuable, spacer blocks aren’t quite as charming!
The best way to fix this issue is by hiding the spacer blocks on mobile screens only. Yes! You can hide specific blocks when the site is being viewed on a mobile device. And it’s super straightforward. Let me show you how.
Every Squarespace page is assigned a Collection ID which allows us to target the content on just that page using CSS. First we need to find out what the Collection ID is for your page.
@media all and (max-width: 450px) {
#YOURCOLLECTIONID .sqs-block-spacer {
display: none !important; } }
Aaaaand **mic drop**!
Check your site on a mobile device to check it has worked correctly
Tip: If you want to apply this code to your entire site, simply remove the Collection ID (including the hashtag) from the line of code.
Some Squarespace users have learned to change the colour of a section background by uploading an image of the colour. This method works OK, however it is not the best option when it comes to SEO. Ultimately, it will slow down the speed at which your page loads which can have an impact on your search engine rankings. Additionally, you may have noticed that when you upload an image, it changes the brightness of the colour.
There is a simple CSS solution to both of these issues. Le go!
#SECTION-NAME { background-color: #000000; }
Want to add a little more personality to your site? Adding a button hover effect is a fun way to reinforce your brand identity and encourage your users to “Click here!”. This piece of code is super easy to install.
.sqs-block-button-element:hover {background-color:#000000; color:#000000}
Easy! This code will apply the hover effect to every button on your site. Want to apply it to specific buttons only? Use the Block ID instructions in the “Change Specific Button Colours” tweak!
At Hello Magic, we are in love with Showit. We’re all about building beautiful websites that attract your dream customers and the only thing better than a gorgeous online home is a gorgeous online home that converts. To get the best of both worlds, you need to know how to optimise your Showit site for SEO.
Excellent photography is one of the key ingredients in a show-stopping, stand-out-from-the-crowd kind of website. Here are our top tips for planning a brand photoshoot that will produce website-worthy images.
“Should I use Showit or Squarespace for my website?” This is a question we hear from many clients. And no wonder. Figuring out whether you should create a website using Squarespace or Showit is like trying to find a consensus over whether pineapple belongs on pizza or not.
Are you considering investing in professional branding or a rebranding project but unsure if it’s even worth it? It’s a valid concern. After all, there are many factors to take into account when making such an important decision for your business. To help you out, we’ll share with you a few cold, hard stats about the benefits of branding that just might convince you to take the plunge.
Template or custom: which is right for you? In this post, we compare all the differences between a custom Showit design and a Showit premade template to figure out which option is best for you and your business.
At Hello Magic, we are in love with Showit. We’re all about building beautiful websites that attract your dream customers and the only thing better than a gorgeous online home is a gorgeous online home that converts. To get the best of both worlds, you need to know how to optimise your Showit site for SEO.
Are you considering investing in professional branding or a rebranding project but unsure if it’s even worth it? It’s a valid concern. After all, there are many factors to take into account when making such an important decision for your business. To help you out, we’ll share with you a few cold, hard stats about the benefits of branding that just might convince you to take the plunge.